diff options
| author | Jonathan Amsterdam <jba@google.com> | 2024-08-23 16:22:05 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2024-08-24 13:58:12 +0000 |
| commit | 676c19eae995f25cccb1e097a1308caecf93d08a (patch) | |
| tree | 5138534345b1c56583f900fe0a46bea769166551 /all.bash | |
| parent | 9b36df45a0f42131a24decf80b4aabe191b5fb30 (diff) | |
| download | go-x-pkgsite-676c19eae995f25cccb1e097a1308caecf93d08a.tar.xz | |
all: get all.bash to work
- Fix npm vulns.
- Fix the minimized-css check to look only at the working dir.
Change-Id: Iecf2c5ef35813fef16df22147f795cda814fef2b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/608037
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'all.bash')
| -rwxr-xr-x | all.bash | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -39,7 +39,7 @@ filter() { # they are staged for commit, use those. # Otherwise, use the files changed since the previous commit. modified_files() { - local working="$(diff_files '') $(diff_files --cached)" + local working=$(working_files) if [[ $working != ' ' ]]; then echo $working elif [[ $(git rev-parse HEAD) = $(git rev-parse master) ]]; then @@ -49,6 +49,11 @@ modified_files() { fi } +# Return the files in the working directory that have not been added to the commit. +working_files() { + echo "$(diff_files '') $(diff_files --cached)" +} + # Helper for modified_files. It asks git for all modified, added or deleted # files, and keeps only the latter two. @@ -181,8 +186,7 @@ check_script_hashes() { # run_build_static builds JavaScript output from TypeScript source files. run_build_static() { runcmd $GO run ./devtools/cmd/static - files=$(modified_files) - echo "mod: $files" + files=$(working_files) if [[ $(filter "$files" 'static/**/*.min*') != '' ]]; then err "minimized CSS files are not consistent with unminimized ones; run ./devtools/cmd/static to regenerate them" fi |
