mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
26 lines
876 B
JavaScript
Executable File
26 lines
876 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
|
|
const parseFile = function (path) {
|
|
|
|
if (!fs.existsSync(path)) {
|
|
console.error(`${path}文件不存在`)
|
|
return;
|
|
}
|
|
let content = JSON.parse(fs.readFileSync(path, "utf8"));
|
|
|
|
content.name = "wechat-devtools";
|
|
// 开启调试,更新参数
|
|
content['chromium-args'] = content['chromium-args'].replace('--disable-devtools', '--mixed-context').replace('--ignore-gpu-blacklist', '--ignore-gpu-blocklist')
|
|
content.window.height = content.window.width = 1000
|
|
fs.writeFileSync(path, JSON.stringify(content));
|
|
|
|
};
|
|
|
|
let basedir = __dirname;
|
|
if(undefined !== process.env['srcdir'])
|
|
basedir = process.env['srcdir'] + '/tools';
|
|
parseFile(path.resolve(basedir, "../package.nw/package.json"));
|
|
parseFile(path.resolve(basedir, "../package.nw/package-lock.json"));
|