Skip to content

Commit

Permalink
Replace sed with perl etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
graphemecluster committed Dec 4, 2024
1 parent f30e072 commit b7fa79d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .ci/package-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pushd Squirrel.app/Contents
# Then, download the latest schemas we need and amend the `default.yaml`
rm SharedSupport/*.*
export rime_dir=SharedSupport
"$SCRIPT_DIR/rime-install.sh"
source "$SCRIPT_DIR/rime-install.sh"
popd

# Compress back the application
Expand Down
4 changes: 2 additions & 2 deletions .ci/package-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd output
# List all files with name ending with `_1`, compare the content of these files and the files with the same names but does not end with `_1` whether these binaries is 32-bit or 64-bit
# Then, move the ones that are 32-bit to the `Win32` folder and remove `_1` from the name of all the files
mkdir Win32
for file in $(find . -name '*_1.*'); do
for file in *_1.*; do
extension="${file##*.}"
base_file="${file%_1.*}.$extension"
if [[ $(file "$base_file") != *"x86-64"* ]]; then
Expand All @@ -27,7 +27,7 @@ done
# Then, download the latest schemas we need and amend the `default.yaml`
rm data/*.*
export rime_dir=data
"$SCRIPT_DIR/rime-install.sh"
source "$SCRIPT_DIR/rime-install.sh"

# Finally, rebuild the installer
mkdir ../resource
Expand Down
20 changes: 10 additions & 10 deletions .ci/rime-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ curl -fsSL https://git.io/rime-install | bash -s -- prelude essay cantonese emoj

if [ -n "$rime_dir" ]; then
pushd "$rime_dir"
sed '/^schema_list:$/,/^$/c\
installed_from: rime-cantonese\
\
schema_list:\
- schema: jyut6ping3\
- schema: cangjie5\
- schema: stroke\
- schema: luna_pinyin\
' default.yaml > default.yaml # avoid behavioral difference of the --in-place option
sed 's/page_size: [0-9]\+/page_size: 8/' default.yaml > default.yaml
perl -0777 -i -pe 's/\nschema_list:\n.*?\n\n/
installed_from: rime-cantonese
schema_list:
- schema: jyut6ping3
- schema: cangjie5
- schema: stroke
- schema: luna_pinyin
/s; s/page_size: [0-9]+/page_size: 8/' default.yaml
rm emoji_cantonese_suggestion.yaml
popd
fi

0 comments on commit b7fa79d

Please sign in to comment.