diff --git a/packages/core/src/modules/plugin/node/config.js b/packages/core/src/modules/plugin/node/config.js index f9697a1..1463f50 100644 --- a/packages/core/src/modules/plugin/node/config.js +++ b/packages/core/src/modules/plugin/node/config.js @@ -14,15 +14,11 @@ module.exports = { 'yarnRegistry': 'default', 'registry': 'https://registry.npmjs.org', // 可以选择切换官方或者淘宝镜像 }, - // intercepts: { - // 'cdn.cypress.io': [{ regexp: '/desktop/.*', proxy: 'http://npmmirror.com/mirrors/cypress/' }] - // }, variables: { phantomjs_cdnurl: 'https://npmmirror.com/mirrors/phantomjs', chromedriver_cdnurl: 'https://npmmirror.com/mirrors/chromedriver', sass_binary_site: 'https://npmmirror.com/mirrors/node-sass', ELECTRON_MIRROR: 'https://npmmirror.com/mirrors/electron/', - // CYPRESS_DOWNLOAD_MIRROR: 'https://cdn.cypress.io', NVM_NODEJS_ORG_MIRROR: 'https://npmmirror.com/mirrors/node', CHROMEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/chromedriver', OPERADRIVER: 'https://npmmirror.com/mirrors/operadriver', diff --git a/packages/core/src/modules/plugin/pip/index.js b/packages/core/src/modules/plugin/pip/index.js index 63572ce..0ac81aa 100644 --- a/packages/core/src/modules/plugin/pip/index.js +++ b/packages/core/src/modules/plugin/pip/index.js @@ -52,8 +52,7 @@ const PipPlugin = function (context) { cmds.push(`${command} config unset global.${item.key}`) } } - const ret = await shell.exec(cmds, { type: 'cmd' }) - return ret + return await shell.exec(cmds, { type: 'cmd' }) }, async unsetPipEnv (list) { @@ -62,8 +61,7 @@ const PipPlugin = function (context) { for (const item of list) { cmds.push(`${command} config unset global.${item} `) } - const ret = await shell.exec(cmds, { type: 'cmd' }) - return ret + return await shell.exec(cmds, { type: 'cmd' }) }, async setRegistry ({ registry }) { diff --git a/packages/core/src/modules/server/index.js b/packages/core/src/modules/server/index.js index 25eb877..58fe413 100644 --- a/packages/core/src/modules/server/index.js +++ b/packages/core/src/modules/server/index.js @@ -104,7 +104,7 @@ const serverApi = { log.error('server process uncaughtException:', err) }) serverProcess.on('message', (msg) => { - log.info('收到子进程消息:', JSON.stringify(msg)) + log.debug('收到子进程消息:', JSON.stringify(msg)) if (msg.type === 'status') { fireStatus(msg.event) } else if (msg.type === 'error') { diff --git a/packages/core/src/shell/scripts/kill-by-port.js b/packages/core/src/shell/scripts/kill-by-port.js index 33e3c66..248eb4a 100644 --- a/packages/core/src/shell/scripts/kill-by-port.js +++ b/packages/core/src/shell/scripts/kill-by-port.js @@ -5,8 +5,7 @@ const execute = Shell.execute const executor = { async windows (exec, { port }) { const cmds = [`for /f "tokens=5" %a in ('netstat -aon ^| find ":${port}" ^| find "LISTENING"') do (taskkill /f /pid %a & exit /B) `] - // eslint-disable-next-line no-unused-vars - const ret = await exec(cmds, { type: 'cmd' }) + await exec(cmds, { type: 'cmd' }) return true }, async linux (exec, { port }) { diff --git a/packages/core/src/shell/scripts/set-npm-env.js b/packages/core/src/shell/scripts/set-npm-env.js index 37c92ed..e80855d 100644 --- a/packages/core/src/shell/scripts/set-npm-env.js +++ b/packages/core/src/shell/scripts/set-npm-env.js @@ -11,8 +11,7 @@ const executor = { for (const item of list) { cmds.push(`npm config set ${item.key} ${item.value}`) } - const ret = await exec(cmds, { type: 'cmd' }) - return ret + return await exec(cmds, { type: 'cmd' }) }, async linux (exec, { port }) { throw new Error('暂未实现此功能') diff --git a/packages/core/src/shell/scripts/set-system-env.js b/packages/core/src/shell/scripts/set-system-env.js index 8e7abef..828e5cd 100644 --- a/packages/core/src/shell/scripts/set-system-env.js +++ b/packages/core/src/shell/scripts/set-system-env.js @@ -19,8 +19,7 @@ const executor = { // [Environment]::SetEnvironmentVariable('FOO', 'bar', 'Machine') cmds2.push(`set ${item.key}=""`) } - // eslint-disable-next-line no-unused-vars - const ret2 = await exec(cmds2, { type: 'cmd' }) + await exec(cmds2, { type: 'cmd' }) return ret }, async linux (exec, { port }) { diff --git a/packages/core/src/shell/shell.js b/packages/core/src/shell/shell.js index a0f6bc7..1dd40bd 100644 --- a/packages/core/src/shell/shell.js +++ b/packages/core/src/shell/shell.js @@ -54,9 +54,7 @@ class WindowsSystemShell extends SystemShell { } try { - const ret = await ps.invoke() - // log.info('ps complete', cmds) - return ret + return await ps.invoke() } finally { ps.dispose() } @@ -66,9 +64,7 @@ class WindowsSystemShell extends SystemShell { compose += ` && ${cmd}` } // compose += '&& exit' - const ret = await childExec(compose, args) - // log.info('cmd complete:', compose) - return ret + return await childExec(compose, args) } } } diff --git a/packages/gui/pkg/after-pack.js b/packages/gui/pkg/after-pack.js index 699593b..6e3138e 100644 --- a/packages/gui/pkg/after-pack.js +++ b/packages/gui/pkg/after-pack.js @@ -18,9 +18,8 @@ updaterCacheDirName: '@docmirrordev-sidecar-gui-updater' fs.writeFileSync(filePath, fileContent) } exports.default = async function (context) { - // console.log('context', context) let targetPath - let systemType = '' + let systemType if (context.packager.platform.nodeName === 'darwin') { targetPath = path.join(context.appOutDir, `${context.packager.appInfo.productName}.app/Contents/Resources`) systemType = 'mac' diff --git a/packages/gui/src/view/App.vue b/packages/gui/src/view/App.vue index d8b58b8..6a66503 100644 --- a/packages/gui/src/view/App.vue +++ b/packages/gui/src/view/App.vue @@ -148,7 +148,7 @@ export default { style="inset:auto auto 53px 210px; background-color:#ddd" /> - +