@@ -211,98 +211,6 @@ const upgrade = function (extractPath) {
211211 } ) ;
212212} ;
213213
214- // const patch_wechat_devtools_package_name = function () {
215- // info("Patching wechat-devtools package name");
216-
217- // return new Promise((resolve, reject) => {
218- // spawn(path.resolve(__dirname, "fix-package-name.js"), [], {
219- // stdio: "inherit",
220- // }).on("close", (code) => {
221- // resolve();
222- // });
223- // });
224- // };
225- // const patch_wechat_devtools_editor_selection_autocopy = function () {
226- // info("Patching wechat-devtools editor selection autocopy");
227-
228- // return new Promise((resolve, reject) => {
229- // spawn(path.resolve(__dirname, "fix-selection-copy-node"), [], {
230- // stdio: "inherit",
231- // }).on("close", (code) => {
232- // resolve();
233- // });
234- // });
235- // };
236- // const patch_wechat_devtools_CLI = function () {
237- // info("Patching wechat-devtools CLI supports");
238-
239- // return new Promise((resolve, reject) => {
240- // spawn(path.resolve(__dirname, "fix-cli.sh"), [], {
241- // stdio: "inherit",
242- // }).on("close", (code) => {
243- // resolve();
244- // });
245- // });
246- // };
247- // const patch_wechat_devtools_core = function () {
248- // info("Patching wechat-devtools core.wxvpkg");
249-
250- // return new Promise((resolve, reject) => {
251- // spawn(path.resolve(__dirname, "fix-core.sh"), [], {
252- // stdio: "inherit",
253- // }).on("close", (code) => {
254- // resolve();
255- // });
256- // });
257- // };
258- // const rebuild_wechat_devtools_node_modules = function () {
259- // info("Rebuilding wechat-devtools node modules");
260-
261- // return new Promise((resolve, reject) => {
262- // const nwConfig = require(path.resolve(__dirname, "../conf/nwjs.json"));
263- // const e = spawn(
264- // path.resolve(__dirname, "rebuild-node-modules.sh"),
265- // [nwConfig.version],
266- // {
267- // stdio: "inherit",
268- // }
269- // );
270- // e.on("error", (code) => {
271- // reject(code);
272- // });
273- // e.on("close", (code) => {
274- // console.info(
275- // `Rebuilding wechat-devtools node modules Result Code: ${code}`
276- // );
277- // if (0 === code) resolve();
278- // else {
279- // reject(code);
280- // }
281- // });
282- // });
283- // };
284- // const patch_wechat_devtools = function () {
285- // info("Patching wechat-devtools");
286-
287- // return new Promise((resolve, reject) => {
288- // const exec = spawn(path.resolve(__dirname, "fix-menu.sh"), [], {
289- // stdio: "inherit",
290- // });
291- // exec.on("close", (code) => {
292- // resolve();
293- // });
294- // });
295- // };
296- // const patch_other = function () {
297- // info("Patching Other");
298-
299- // return new Promise((resolve, reject) => {
300- // execSync(path.resolve(__dirname, "fix-other.sh"));
301-
302- // resolve();
303- // });
304- // };
305-
306214const start = async ( ) => {
307215 try {
308216 const url = await fetching ( ) ;
@@ -314,6 +222,9 @@ const start = async () => {
314222 path . resolve ( __dirname , "../package.nw/.build_time" ) ,
315223 "" + parseInt ( new Date ( ) . getTime ( ) / 1000 )
316224 ) ;
225+ const cfg = require ( path . resolve ( __dirname , '../conf/config.json' ) )
226+ cfg . devtools . version = version
227+ fs . writeFileSync ( path . resolve ( __dirname , '../conf/config.json' ) , JSON . stringify ( cfg , null , 4 ) )
317228 console . log (
318229 `Succeeded upgrading wechat-devtools to version ${ version } `
319230 ) ;
0 commit comments