mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
19 lines
782 B
JavaScript
Executable File
19 lines
782 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
|
|
console.info("Patching CLI command");
|
|
|
|
const rootDir = path.dirname(__dirname);
|
|
|
|
let cli = fs.readFileSync(path.resolve(rootDir, "package.nw/js/common/cli/index.js"), "utf8");
|
|
|
|
cli = cli.replace(/USERPROFILE/g, "HOME");
|
|
cli = cli.replace(/AppData\/Local\/\$\{global\.userDirName\}\/User Data/g,
|
|
".config/${global.userDirName}");
|
|
cli = cli.replace(/`\.\/\$\{global.appname\}\.exe`/g,
|
|
"require(\"path\").join(__dirname, \"../../../../bin/wechat-devtools\")");
|
|
cli = cli.replace(/"\.\.\/\.\.\/\.\.\/\.\.\/resources_win\/nw\/x64\/nw.exe"/g,
|
|
"\"../../../../nwjs/nw\"");
|
|
|
|
fs.writeFileSync(path.resolve(rootDir, "package.nw/js/common/cli/index.js"), cli); |