race condition?

This commit is contained in:
Neale Pickett 2022-01-09 20:39:22 -07:00
parent 5ee0655e6e
commit f080064d4e
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@ getenv () {
setenv () {
(cat env.json 2>/dev/null || echo '{}') \
| jq --arg key "$1" --arg val "$2" '.[$key] = $val' \
| sponge env.json
> env.json.new \
&& mv env.json.new env.json
}