From 330599d84bbf6446d62a9c3ac83423e0487fd1d8 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 12 Feb 2021 07:40:57 +0100 Subject: [PATCH] Added (enforced) shellcheck --- .gitlab-ci.yml | 7 +++++++ bootstrap-root.sh | 5 ++++- bootstrap-user.sh | 4 ++-- bootstrap.sh | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d22db3a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,7 @@ +--- +test:shellcheck: + stage: test + image: koalaman/shellcheck-alpine + script: + shellcheck *.sh +... diff --git a/bootstrap-root.sh b/bootstrap-root.sh index be926db..380fd05 100755 --- a/bootstrap-root.sh +++ b/bootstrap-root.sh @@ -38,10 +38,12 @@ apt-get update \ && apt-file update # node related +# shellcheck disable=SC2086 curl $CURLOPT https://deb.nodesource.com/setup_14.x | bash - apt-get install -y nodejs # python3 related +# shellcheck disable=SC2086 curl $CURLOPT https://bootstrap.pypa.io/get-pip.py | python3 pip install ranger-fm @@ -50,5 +52,6 @@ pip install ranger-fm cargo install --root /usr/local --git https://github.com/mookid/diffr +# shellcheck disable=SC2086 curl $CURLOPT -o /usr/local/sbin/cleanup.sh https://gist.github.com/schtobia/f02deeaf2fd20b23ae9fcf0f451cc858/raw/cleanup.sh \ - && chmod u+x /usr/local/sbin/cleanup.sh + && chmod u+x /usr/local/sbin/cleanup.sh diff --git a/bootstrap-user.sh b/bootstrap-user.sh index 24dc62e..fed69ef 100755 --- a/bootstrap-user.sh +++ b/bootstrap-user.sh @@ -7,10 +7,10 @@ TMPDIR=$(mktemp -u -p "$HOME" -d dotfiles.XXXXX) && \ [ -r "$TMPDIR/.gitmodules" ] && cp -vi "$TMPDIR/.gitmodules" "$HOME" [ -d "$HOME/.cfg" ] && \ git --git-dir="$HOME/.cfg/" --work-tree="$HOME" config status.showUntrackedFiles no && \ - (cd $HOME && \ + (cd "$HOME" && \ git --git-dir="$HOME/.cfg/" --work-tree="$HOME" checkout -- . && \ git --git-dir="$HOME/.cfg/" --work-tree="$HOME" submodule update --init --remote --recursive --rebase) -rm -rf $TMPDIR +rm -rf "$TMPDIR" pip install --user -r https://github.com/schtobia/bootstrap/raw/master/requirements.txt diff --git a/bootstrap.sh b/bootstrap.sh index 3d7a545..5817b10 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -4,7 +4,9 @@ set -e CURLOPT=${CURLOPT:-"--location --remote-time --show-error --silent --fail --tlsv1.2"} # root part +# shellcheck disable=SC2086 curl $CURLOPT https://github.com/schtobia/bootstrap/raw/master/bootstrap-root.sh | sudo -SEH bash - # userspace part +# shellcheck disable=SC2086 curl $CURLOPT https://github.com/schtobia/bootstrap/raw/master/bootstrap-user.sh | bash -