Files
dotfiles/meta/submodules
druckdev 4cb445c2b5 shell-scripts: Use [[ instead of [ where possible
Replace all occurrences of [ with [[ in bash and zsh scripts and
configs.
Performance wise it makes sense to use the builtin instead of calling an
external command also when from a functionality stand point `test` would
suffice.
2020-10-03 01:29:29 +02:00

18 lines
355 B
Bash
Executable File

#!/bin/bash
[[ $# -eq 1 ]] || { echo "Specify what to do" >&2; exit 1; }
case "$1" in
"--init") INIT=1;;
"--update") INIT=0;;
*) echo "Unknown option"; exit 1;;
esac
if (( $INIT )); then
git submodule update --init --recursive --jobs 8 --depth 1 2>&1 \
| grep "Cloning into" \
|| ! (( ${PIPESTATUS[0]} ))
else
git submodule update --remote
fi