summarylogtreecommitdiffstats
path: root/fix-package-name-node
blob: c8d1a0c2499cb09c034b524676cdbb3300ace52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env node
const path = require("path");
const fs = require("fs");

const parseFile = function (path) {

    console.log("fix start")
    if (!fs.existsSync(path)) {
        return;
    }
    console.log("content")
    let content = JSON.parse(fs.readFileSync(path, "utf8"));

    content.name = "wechat_devtools";
    // 开启调试,更新参数
    content['chromium-args'] = content['chromium-args'].replace('--ignore-gpu-blacklist', '--ignore-gpu-blocklist') + ' --mixed-context'
    content.window.height = content.window.width = 1000
    fs.writeFileSync(path, JSON.stringify(content, null, 4));

};

const pkgDir = process.env['NW_PACKAGE_DIR']
parseFile(`${pkgDir}/package.json`);
parseFile(`${pkgDir}/package-lock.json`);