From 8ace86f7da41e16343f18007914840bf77f1adf4 Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Fri, 13 Sep 2019 14:50:49 +0200 Subject: [PATCH] Use sponge to avoid need for temp file Signed-off-by: Pedro Pombeiro --- nix/desktop/default.nix | 3 ++- scripts/build-desktop.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nix/desktop/default.nix b/nix/desktop/default.nix index 6d23efa08b..ac6b7cffaa 100644 --- a/nix/desktop/default.nix +++ b/nix/desktop/default.nix @@ -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); diff --git a/scripts/build-desktop.sh b/scripts/build-desktop.sh index 1e82c2c891..d8c6e904bb 100755 --- a/scripts/build-desktop.sh +++ b/scripts/build-desktop.sh @@ -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 ""