Skip to content

Commit

Permalink
Replace macos sed with gnu sed
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIMkaRU committed Jan 15, 2024
1 parent eab5331 commit 3df3ac9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build-electron-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
submodules: recursive
- name: Set repo owner
run: |
sed -i'' -e \
sed -i -e \
"s/owner: '.*'/owner: '${{ github.repository_owner }}'/g" \
"./electron-builder-config.js"
- if: github.event.inputs.version != ''
name: Set release version
run: |
sed -i'' -e \
sed -i -e \
"s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.version }}\"/g" \
"./package.json"
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isAutoUpdateDisabled)
Expand Down Expand Up @@ -106,15 +106,19 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: Replace macOS’s sed with GNU’s sed
run: |
brew install gnu-sed
PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
- name: Set repo owner
run: |
sed -i'' -e \
sed -i -e \
"s/owner: '.*'/owner: '${{ github.repository_owner }}'/g" \
"./electron-builder-config.js"
- if: github.event.inputs.version != ''
name: Set release version
run: |
sed -i'' -e \
sed -i -e \
"s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.version }}\"/g" \
"./package.json"
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isAutoUpdateDisabled)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.win-builder
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY ./scripts/helpers/install-nodejs.sh ./scripts/helpers/install-nodejs.sh
RUN ./scripts/helpers/install-nodejs.sh ${NODE_VERSION} \
# Remove the `Wine` source entry to resolve
# the release key expiration issue for `apt-get update`
&& sed -i'' '/Wine/d' /etc/apt/sources.list \
&& sed -i '/Wine/d' /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
p7zip-full \
Expand Down
10 changes: 5 additions & 5 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,22 @@ fi
if [ $isDevEnv == 1 ]; then
echo -e "\n${COLOR_YELLOW}Developer environment is turned on!${COLOR_NORMAL}"

sed -i'' -e \
sed -i -e \
"s/\"NODE_ENV\": \".*\"/\"NODE_ENV\": \"development\"/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
else
sed -i'' -e \
sed -i -e \
"s/\"NODE_ENV\": \".*\"/\"NODE_ENV\": \"production\"/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
fi
if [ $isAutoUpdateDisabled == 1 ]; then
echo -e "\n${COLOR_YELLOW}Auto-update is turned off!${COLOR_NORMAL}"

sed -i'' -e \
sed -i -e \
"s/\"IS_AUTO_UPDATE_DISABLED\": .*/\"IS_AUTO_UPDATE_DISABLED\": true/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
else
sed -i'' -e \
sed -i -e \
"s/\"IS_AUTO_UPDATE_DISABLED\": .*/\"IS_AUTO_UPDATE_DISABLED\": false/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
fi
Expand Down Expand Up @@ -186,7 +186,7 @@ cp "$EXPRESS_FOLDER/config/default.json.example" \
echo -e "\n${COLOR_BLUE}Setting backend configs${COLOR_NORMAL}"

escapedBfxApiUrl=$(escapeString $bfxApiUrl)
sed -i'' -e \
sed -i -e \
"s/\"restUrl\": \".*\"/\"restUrl\": \"$escapedBfxApiUrl\"/g" \
"$WORKER_FOLDER/config/service.report.json"

Expand Down
18 changes: 9 additions & 9 deletions scripts/build-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,32 @@ echo -e "\n${COLOR_BLUE}Setting UI configs${COLOR_NORMAL}"

escapedBfxHomeUrl=$(escapeString $bfxHomeUrl)
escapedBfxKeyUrl=$(escapeString $bfxKeyUrl)
sed -i'' -e \
sed -i -e \
"s/HOME_URL: .*,/HOME_URL: \'$escapedBfxHomeUrl\',/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/API_URL: .*,/API_URL: \'http:\/\/${BACKEND_ADDRESS}\/api\',/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/WS_ADDRESS: .*,/WS_ADDRESS: \'ws:\/\/${BACKEND_ADDRESS}\/ws\',/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/KEY_URL: .*,/KEY_URL: \'$escapedBfxKeyUrl\/api\',/g" \
"$UI_CONFIGS_FILE"

sed -i'' -e \
sed -i -e \
"s/localExport: false/localExport: true/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/showAuthPage: false/showAuthPage: true/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/showFrameworkMode: false/showFrameworkMode: true/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/hostedFrameworkMode: true/hostedFrameworkMode: false/g" \
"$UI_CONFIGS_FILE"
sed -i'' -e \
sed -i -e \
"s/isElectronApp: false/isElectronApp: true/g" \
"$UI_CONFIGS_FILE"

Expand Down
10 changes: 5 additions & 5 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ fi
if [ $isDevEnv == 1 ]; then
echo -e "\n${COLOR_YELLOW}Developer environment is turned on!${COLOR_NORMAL}"

sed -i'' -e \
sed -i -e \
"s/\"NODE_ENV\": \".*\"/\"NODE_ENV\": \"development\"/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
else
sed -i'' -e \
sed -i -e \
"s/\"NODE_ENV\": \".*\"/\"NODE_ENV\": \"production\"/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
fi
if [ $isAutoUpdateDisabled == 1 ]; then
echo -e "\n${COLOR_YELLOW}Auto-update is turned off!${COLOR_NORMAL}"

sed -i'' -e \
sed -i -e \
"s/\"IS_AUTO_UPDATE_DISABLED\": .*/\"IS_AUTO_UPDATE_DISABLED\": true/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
else
sed -i'' -e \
sed -i -e \
"s/\"IS_AUTO_UPDATE_DISABLED\": .*/\"IS_AUTO_UPDATE_DISABLED\": false/g" \
"$ROOT/$ELECTRON_ENV_FILE_NAME"
fi
Expand Down Expand Up @@ -132,7 +132,7 @@ cp "$EXPRESS_FOLDER/config/default.json.example" \
echo -e "\n${COLOR_BLUE}Setting backend configs${COLOR_NORMAL}"

escapedBfxApiUrl=$(escapeString $bfxApiUrl)
sed -i'' -e \
sed -i -e \
"s/\"restUrl\": \".*\"/\"restUrl\": \"$escapedBfxApiUrl\"/g" \
"$WORKER_FOLDER/config/service.report.json"

Expand Down

0 comments on commit 3df3ac9

Please sign in to comment.