Use sponge to avoid need for temp file
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
061939189b
commit
8ace86f7da
|
@ -1,5 +1,5 @@
|
|||
{ stdenv, pkgs, callPackage, target-os,
|
||||
cmake, extra-cmake-modules, file, status-go, go,
|
||||
cmake, extra-cmake-modules, file, moreutils, status-go, go,
|
||||
darwin, nodejs }:
|
||||
|
||||
let
|
||||
|
@ -21,6 +21,7 @@ in {
|
|||
cmake
|
||||
extra-cmake-modules
|
||||
file
|
||||
moreutils
|
||||
snoreNotifySources
|
||||
qtkeychainSources
|
||||
] ++ catAttrs "buildInputs" selectedSources);
|
||||
|
|
|
@ -115,8 +115,8 @@ function compile() {
|
|||
# Temporarily add path to javascript bundle to package.json
|
||||
local jsBundleLine="\"desktopJSBundlePath\": \"$JS_BUNDLE_PATH\""
|
||||
local jsPackagePath=$(joinExistingPath "$STATUS_REACT_HOME" 'desktop/js_files/package.json')
|
||||
local tmp=$(mktemp)
|
||||
jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath"
|
||||
|
||||
jq ".=(. + {$jsBundleLine})" "$jsPackagePath" | sponge "$jsPackagePath"
|
||||
echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}"
|
||||
echo ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue