summarylogtreecommitdiffstats
path: root/fix-cli.sh
blob: 3cd64791f10a8ac8a3c3f7397f2d91442480fdd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash

set -e
root_dir=$(cd `dirname $0`/.. && pwd -P)
NW_PACKAGE_DIR="$root_dir/package.nw"

if [ -z "$NW_PACKAGE_DIR" ]; then
    echo -e "\e[1;31m\$NW_PACKAGE_DIR is empty\e[0m" >&2
    exit 1
fi

cd "$NW_PACKAGE_DIR"

sed -i 's#AppData/Local/\${global.userDirName}/User Data/\${global.productHash}/Default#.config/\${global.userDirName}/Default#g' js/common/cli/index.js
sed -i 's#USERPROFILE#HOME#g' js/common/cli/index.js
sed -i 's#`./\${global.appname}.exe`#`./bin/\${global.appname}`#g' js/common/cli/index.js
sed -i 's#,""));const T#,""));_.$0="wechat-devtools-cli";const T#' js/common/cli/index.js