Skip to content

Commit

Permalink
fix - shellcheck violations for cron.sh
Browse files Browse the repository at this point in the history
Fixed the shellcheck violations in cron.sh
  • Loading branch information
naveensrinivasan committed Dec 22, 2020
1 parent 6549ecc commit 3de6a1b
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 3de6a1b

Please sign in to comment.