diff options
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 |
