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,
|
{ stdenv, pkgs, callPackage, target-os,
|
||||||
cmake, extra-cmake-modules, file, status-go, go,
|
cmake, extra-cmake-modules, file, moreutils, status-go, go,
|
||||||
darwin, nodejs }:
|
darwin, nodejs }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -21,6 +21,7 @@ in {
|
||||||
cmake
|
cmake
|
||||||
extra-cmake-modules
|
extra-cmake-modules
|
||||||
file
|
file
|
||||||
|
moreutils
|
||||||
snoreNotifySources
|
snoreNotifySources
|
||||||
qtkeychainSources
|
qtkeychainSources
|
||||||
] ++ catAttrs "buildInputs" selectedSources);
|
] ++ catAttrs "buildInputs" selectedSources);
|
||||||
|
|
|
@ -115,8 +115,8 @@ function compile() {
|
||||||
# Temporarily add path to javascript bundle to package.json
|
# Temporarily add path to javascript bundle to package.json
|
||||||
local jsBundleLine="\"desktopJSBundlePath\": \"$JS_BUNDLE_PATH\""
|
local jsBundleLine="\"desktopJSBundlePath\": \"$JS_BUNDLE_PATH\""
|
||||||
local jsPackagePath=$(joinExistingPath "$STATUS_REACT_HOME" 'desktop/js_files/package.json')
|
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 -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue