From e56496e3af698b078faa94beab2c1f7a3517c426 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Mon, 17 Jul 2023 00:41:03 +0200 Subject: [PATCH] chore: Enable shellcheck --- .pre-commit-config.yaml | 2 +- flake.nix | 1 + home/programs/scripts/attic-system-cache | 2 +- home/programs/scripts/copy-git-repo-contents | 5 +++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f636820..00b9be1 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/f6q34qz3fmnjqv3blhy0nb5sdp94jhva-pre-commit-config.json \ No newline at end of file +/nix/store/zlf0hrr61mqr4bkjndn922cj615q447g-pre-commit-config.json \ No newline at end of file diff --git a/flake.nix b/flake.nix index 569b491..48b2ad3 100644 --- a/flake.nix +++ b/flake.nix @@ -147,6 +147,7 @@ hooks = { deadnix.enable = true; + shellcheck.enable = true; statix.enable = true; treefmt.enable = true; }; diff --git a/home/programs/scripts/attic-system-cache b/home/programs/scripts/attic-system-cache index 0f30017..d4a4405 100755 --- a/home/programs/scripts/attic-system-cache +++ b/home/programs/scripts/attic-system-cache @@ -6,7 +6,7 @@ export IFS=' ' echo "Uploading $OUT_PATHS ..." -if /run/current-system/sw/bin/attic push nifoc-systems $OUT_PATHS; then +if /run/current-system/sw/bin/attic push nifoc-systems "$OUT_PATHS"; then exit 0 else echo "Ignoring error ..." diff --git a/home/programs/scripts/copy-git-repo-contents b/home/programs/scripts/copy-git-repo-contents index 815ebfd..2d29d1c 100755 --- a/home/programs/scripts/copy-git-repo-contents +++ b/home/programs/scripts/copy-git-repo-contents @@ -1,15 +1,16 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p coreutils findutils rsync +# shellcheck disable=SC1008 current="$PWD" src="$(realpath "$1")" dst="$(realpath "$2")" -cd "$dst" +cd "$dst" || exit find . -not -path './.git/*' -not -path './.git' -not -path '.' -not -path '..' -print0 | xargs -0 rm -rf rsync -ax "$src/" ./ --exclude .git --exclude deps --exclude _build rm -rf ./.gitlab rm -f ./.gitlab-ci.yml -cd "$current" +cd "$current" || exit