Skip to content

Commit

Permalink
fix: patch md5 in config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed Feb 3, 2022
1 parent 0a3d71d commit aa0297d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
sudo rm -rf cache tmp
mkdir ${{ env. name }}
sudo find -maxdepth 1 -not -name ${{ env.name }} -not -name . -exec mv {} ${{ env.name }} \;
ls -l
sudo cp -r "${{ env.name }}/package.nw/node_modules/nodegit" nodegit
sudo cp -r "${{ env.name }}/compiler" compiler
ls -ls
env:
name: 'release-${{ github.ref_name }}'

Expand Down
7 changes: 7 additions & 0 deletions test/fix-md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
package_dir="/mnt/disk1/GitHub/wechat-devtools/package.nw"
cd "${package_dir}/js/vendor" && \
wcc_md5=$( md5sum wcc.exe|cut -d ' ' -f1 ) && \
sed -i 's/wcc.exe": ".*"/wcc.exe": "'"${wcc_md5}"'"/g' "config.json" && \
wcsc_md5=$( md5sum wcsc.exe|cut -d ' ' -f1 ) && \
sed -i 's/wcsc.exe": ".*"/wcsc.exe": "'"${wcsc_md5}"'"/g' "config.json"
12 changes: 9 additions & 3 deletions tools/rebuild-node-modules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
NW_VERSION=$1
srcdir=$(cd `dirname $0`/.. && pwd -P)
package_dir="$DIR/../package.nw"

export PATH="$DIR/../node/bin:$PATH"
Expand All @@ -29,7 +30,6 @@ if [ -z $NW_VERSION ]; then
fi

echo -e "\033[42;37m ######## 版本信息 $(date '+%Y-%m-%d %H:%M:%S') ########\033[0m"
echo "目录: $DIR"
echo "NW VERSION: $NW_VERSION"
echo "nw-gyp version: $( nw-gyp --version )"
echo "node version: $(node --version )"
Expand Down Expand Up @@ -105,14 +105,20 @@ cp -fr "${package_dir}/node_modules_tmp/node_modules/vscode-ripgrep/bin/rg" "${p
cd "${package_dir}/js/vendor/" && rm -rf "wcc.exe" "wcsc.exe"
cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcc" "${package_dir}/js/vendor/wcc.exe"
cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcsc" "${package_dir}/js/vendor/wcsc.exe"
cd "${package_dir}/js/vendor" && \
wcc_md5=$( md5sum wcc.exe|cut -d ' ' -f1 ) && \
sed -i 's/wcc.exe": ".*"/wcc.exe": "'"${wcc_md5}"'"/g' "config.json" && \
wcsc_md5=$( md5sum wcsc.exe|cut -d ' ' -f1 ) && \
sed -i 's/wcsc.exe": ".*"/wcsc.exe": "'"${wcsc_md5}"'"/g' "config.json"

# 可视化编译
(cd "${package_dir}/node_modules/" \
&& rm -rf wcc wcsc \
&& mkdir -p "wcc/bin/linux" "wcsc/bin/linux" \
&& cp -r "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcc" "wcc/bin/linux/wcc" \
&& cp -r "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcsc" "wcsc/bin/linux/wcsc" \
&& cp -r "${package_dir}/../compiler/wcc_node"/* "wcc" \
&& cp -r "${package_dir}/../compiler/wcsc_node"/* "wcsc"
&& cp -r "${srcdir}/compiler/wcc_node"/* "wcc" \
&& cp -r "${srcdir}/compiler/wcsc_node"/* "wcsc"
)

rm -rf "${package_dir}/node_modules_tmp"
Expand Down

0 comments on commit aa0297d

Please sign in to comment.