From 50a570a83fdc449df84d7c077cdcfc1eb49434f0 Mon Sep 17 00:00:00 2001 From: panchajanya Date: Sat, 9 Mar 2024 04:54:36 +0530 Subject: [PATCH] Code Improvements (#11311) build_docker, update-flake: cleanup and apply shellcheck fixes Was editing this file to match my needs while shellcheck warnings bugged me out. REV isn't getting used anywhere. Better remove it. Updates #cleanup Signed-off-by: Panchajanya1999 Signed-off-by: James Tucker --- build_docker.sh | 6 +++--- update-flake.sh | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/build_docker.sh b/build_docker.sh index 30e00d37f..8c134fbc5 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -20,9 +20,9 @@ set -eu # Use the "go" binary from the "tool" directory (which is github.com/tailscale/go) -export PATH=$PWD/tool:$PATH +export PATH="$PWD"/tool:"$PATH" -eval $(./build_dist.sh shellvars) +eval "$(./build_dist.sh shellvars)" DEFAULT_TARGET="client" DEFAULT_TAGS="v${VERSION_SHORT},v${VERSION_MINOR}" @@ -74,4 +74,4 @@ case "$TARGET" in echo "unknown target: $TARGET" exit 1 ;; -esac \ No newline at end of file +esac diff --git a/update-flake.sh b/update-flake.sh index af31c9775..4561183b8 100755 --- a/update-flake.sh +++ b/update-flake.sh @@ -3,14 +3,12 @@ set -eu -REV=$(cat go.toolchain.rev) - OUT=$(mktemp -d -t nar-hash-XXXXXX) -rm -rf $OUT +rm -rf "$OUT" -./tool/go mod vendor -o $OUT -./tool/go run tailscale.com/cmd/nardump --sri $OUT >go.mod.sri -rm -rf $OUT +./tool/go mod vendor -o "$OUT" +./tool/go run tailscale.com/cmd/nardump --sri "$OUT" >go.mod.sri +rm -rf "$OUT" # nix-direnv only watches the top-level nix file for changes. As a # result, when we change a referenced SRI file, we have to cause some