From 644e37c03e642b8a2a649d6beacaf03dff0e8dd8 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 12 Jun 2020 16:06:32 -0700 Subject: [PATCH] shellcheck --- .travis/affects.sh | 4 ++-- .travis/export-github-repo.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis/affects.sh b/.travis/affects.sh index ca87b5bc4d..246c56fe0e 100755 --- a/.travis/affects.sh +++ b/.travis/affects.sh @@ -5,10 +5,10 @@ ( set -x - git diff --name-only $TRAVIS_COMMIT_RANGE + git diff --name-only "$TRAVIS_COMMIT_RANGE" ) -for file in $(git diff --name-only $TRAVIS_COMMIT_RANGE); do +for file in $(git diff --name-only "$TRAVIS_COMMIT_RANGE"); do if [[ $file =~ ^"$1" ]]; then exit 0 fi diff --git a/.travis/export-github-repo.sh b/.travis/export-github-repo.sh index 48a70ab0ba..4a74aaec6d 100755 --- a/.travis/export-github-repo.sh +++ b/.travis/export-github-repo.sh @@ -16,11 +16,11 @@ pip3 install git-filter-repo declare subdir=$1 declare repo_name=$2 -[[ -n $subdir ]] || { +[[ -n "$subdir" ]] || { echo "Error: subdir not specified" exit 1 } -[[ -n $repo_name ]] || { +[[ -n "$repo_name" ]] || { echo "Error: repo_name not specified" exit 1 } @@ -30,9 +30,9 @@ echo "Exporting $subdir" set -x rm -rf .github_export/"$repo_name" -git clone https://${GITHUB_TOKEN}@github.com/solana-labs/"$repo_name" .github_export/"$repo_name" +git clone https://"$GITHUB_TOKEN"@github.com/solana-labs/"$repo_name" .github_export/"$repo_name" # TODO: Try using `--refs $TRAVIS_COMMIT_RANGE` to speed up the filtering git filter-repo --subdirectory-filter "$subdir" --target .github_export/"$repo_name" -git -C .github_export/"$repo_name" push https://${GITHUB_TOKEN}@github.com/solana-labs/"$repo_name" +git -C .github_export/"$repo_name" push https://"$GITHUB_TOKEN"@github.com/solana-labs/"$repo_name"