mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-19 12:06:48 +00:00
Replace sed with jq in build-desktop.sh
This commit is contained in:
parent
f7779023ca
commit
1c7eaf1b76
@ -165,21 +165,12 @@ function buildClojureScript() {
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Add path to javascript bundle to package.json
|
# Add path to javascript bundle to package.json
|
||||||
jsBundleLine="\"desktopJSBundlePath\": \"$WORKFOLDER/Status.jsbundle\""
|
local jsBundleLine="\"desktopJSBundlePath\": \"$WORKFOLDER/Status.jsbundle\""
|
||||||
jsPackagePath=$(joinExistingPath "$STATUSREACTPATH" 'desktop_files/package.json.orig')
|
local jsPackagePath=$(joinExistingPath "$STATUSREACTPATH" 'desktop_files/package.json.orig')
|
||||||
if grep -Fq "$jsBundleLine" "$jsPackagePath"; then
|
local tmp=$(mktemp)
|
||||||
echo -e "${GREEN}Found line in package.json.${NC}"
|
jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath"
|
||||||
else
|
|
||||||
# Add line to package.json just before "dependencies" line
|
|
||||||
if is_macos; then
|
|
||||||
sed -i '' -e "/\"dependencies\":/i\\
|
|
||||||
\ $jsBundleLine," "$jsPackagePath"
|
|
||||||
else
|
|
||||||
sed -i -- "/\"dependencies\":/i\ $jsBundleLine," "$jsPackagePath"
|
|
||||||
fi
|
|
||||||
echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}"
|
echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function compile() {
|
function compile() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user