Discard temporary changes to package.json in build-desktop.sh after compiling

This commit is contained in:
Pedro Pombeiro 2019-03-17 19:15:16 +01:00
parent 9ac7ceb779
commit 214131a5b3
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
1 changed files with 5 additions and 3 deletions

View File

@ -142,17 +142,17 @@ function buildClojureScript() {
--dev false --platform desktop --assets-dest "$WORKFOLDER/assets" --dev false --platform desktop --assets-dest "$WORKFOLDER/assets"
echo -e "${GREEN}Generating done.${NC}" echo -e "${GREEN}Generating done.${NC}"
echo "" echo ""
}
# Add path to javascript bundle to package.json function compile() {
# Temporarily add path to javascript bundle to package.json
local jsBundleLine="\"desktopJSBundlePath\": \"$WORKFOLDER/Status.jsbundle\"" local jsBundleLine="\"desktopJSBundlePath\": \"$WORKFOLDER/Status.jsbundle\""
local jsPackagePath=$(joinExistingPath "$STATUSREACTPATH" 'desktop_files/package.json.orig') local jsPackagePath=$(joinExistingPath "$STATUSREACTPATH" 'desktop_files/package.json.orig')
local tmp=$(mktemp) local tmp=$(mktemp)
jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath" jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath"
echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}" echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}"
echo "" echo ""
}
function compile() {
pushd desktop pushd desktop
rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile modules reportApp/CMakeFiles desktop/node_modules/google-breakpad/CMakeFiles desktop/node_modules/react-native-keychain/desktop/qtkeychain-prefix/src/qtkeychain-build/CMakeFiles desktop/node_modules/react-native-keychain/desktop/qtkeychain rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile modules reportApp/CMakeFiles desktop/node_modules/google-breakpad/CMakeFiles desktop/node_modules/react-native-keychain/desktop/qtkeychain-prefix/src/qtkeychain-build/CMakeFiles desktop/node_modules/react-native-keychain/desktop/qtkeychain
EXTERNAL_MODULES_DIR="$(joinStrings ${external_modules_dir[@]})" EXTERNAL_MODULES_DIR="$(joinStrings ${external_modules_dir[@]})"
@ -179,6 +179,8 @@ function compile() {
$CMAKE_EXTRA_FLAGS || exit 1 $CMAKE_EXTRA_FLAGS || exit 1
make -S -j5 || exit 1 make -S -j5 || exit 1
popd popd
git checkout $jsPackagePath # remove the bundle from the package.json file
} }
function bundleWindows() { function bundleWindows() {