diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2022-05-05 00:15:37 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2022-05-05 00:19:01 -0400 |
| commit | 43f9f228567ce2604cc640f9255ba970b7c06e4d (patch) | |
| tree | d5121cec439fe150259ec8babb48971c21e51644 /process-static | |
| parent | a255769f6143568a9d21071daec21a2165dddfb2 (diff) | |
add file locking to deploy/process scripts
Diffstat (limited to 'process-static')
| -rwxr-xr-x | process-static | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/process-static b/process-static index 88f04d04..bbc7198d 100755 --- a/process-static +++ b/process-static @@ -3,6 +3,18 @@ set -o errexit -o nounset -o pipefail shopt -s dotglob extglob globstar +if [[ $# -eq 1 ]]; then + fd=$1 +else + touch lock + exec {fd}< lock +fi + +if ! flock -n $fd; then + echo deploy_static already locked >&2 + exit 1 +fi + export PATH="$PWD/node_modules/.bin:$PATH" # can use file:// to avoid network requests |
