Skip to content

Commit

Permalink
Merge pull request #102 from naveensrinivasan/fix/shellcheck
Browse files Browse the repository at this point in the history
fix - shellcheck violations for cron.sh
  • Loading branch information
inferno-chromium committed Dec 22, 2020
2 parents 6549ecc + 3de6a1b commit c308663
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cron/cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
# limitations under the License.

SOURCE="${BASH_SOURCE[0]}"
input=$(dirname $SOURCE)/projects.txt
input=$(dirname "$SOURCE")/projects.txt
output=$(date +"%m-%d-%Y").json
touch $output
touch "$output"

# sort and uniqify these, in case there are duplicates
projects=$(cat $input | sort | uniq)
# shellcheck disable=SC2002
projects=$(cat "$input" | sort | uniq)
while read -r proj; do
if [[ $proj =~ ^#.* ]]; then
continue
fi
echo $proj
./scorecard --repo=$proj --format=json >> $output
echo "$proj"
./scorecard --repo="$proj" --format=json >> "$output"
done <<< "$projects"

gsutil cp $output gs://$GCS_BUCKET
gsutil cp "$output" gs://"$GCS_BUCKET"
# Also copy the most recent run into a "latest.json" file
gsutil cp gs://$GCS_BUCKET/$output gs://$GCS_BUCKET/latest.json
gsutil cp gs://"$GCS_BUCKET"/"$output" gs://"$GCS_BUCKET"/latest.json

0 comments on commit c308663

Please sign in to comment.