Skip to content

Commit 45d7118

Browse files
committed
Merge branch 'master' of https://github.com/chengcheng84/dev-sidecar into vue-ant-version
2 parents 476b062 + 94d2159 commit 45d7118

7 files changed

Lines changed: 38 additions & 34 deletions

File tree

.github/workflows/npm-run-electron.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
npm-run-electron:
19-
runs-on: ${{ matrix.os }}-latest
19+
runs-on: ${{ contains(matrix.os, '-arm') && matrix.os || format('{0}-latest', matrix.os) }}
2020
env:
2121
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
2222
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder

packages/core/src/config/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const defaultConfig = {
2323
remoteConfig: {
2424
enabled: true,
2525
// 共享远程配置地址
26-
url: 'https://gitee.com/wangliang181230/dev-sidecar-config/raw/main/remote_config.json',
26+
url: 'https://raw.giteeusercontent.com/wangliang181230/dev-sidecar-config/raw/main/remote_config.json',
2727
// 个人远程配置地址
2828
personalUrl: '',
2929
},
@@ -108,9 +108,9 @@ const defaultConfig = {
108108
},
109109
'^(/[\\w-.]+){2,}/?(\\?.*)?$': {
110110
// 篡改猴插件地址,以下是高速镜像地址
111-
tampermonkeyScript: 'https://gitee.com/wangliang181230/dev-sidecar-config/raw/main/tampermonkey.js',
111+
tampermonkeyScript: 'https://raw.giteeusercontent.com/wangliang181230/dev-sidecar-config/raw/main/tampermonkey.js',
112112
// Github油猴脚本地址,以下是高速镜像地址
113-
script: 'https://gitee.com/wangliang181230/dev-sidecar-config/raw/main/GithubEnhanced-High-Speed-Download.user.js',
113+
script: 'https://raw.giteeusercontent.com/wangliang181230/dev-sidecar-config/raw/main/GithubEnhanced-High-Speed-Download.user.js',
114114
remark: '注:上面所使用的脚本地址,为高速镜像地址。',
115115
desc: '油猴脚本:高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件 (公益加速)、项目列表单文件快捷下载、添加 git clone 命令',
116116
},
@@ -221,7 +221,7 @@ const defaultConfig = {
221221
},
222222
'ajax.googleapis.com': {
223223
'.*': {
224-
proxy: 'ajax.lug.ustc.edu.cn',
224+
proxy: 'ajax.proxy.ustclug.org',
225225
backup: ['gapis.geekzu.org'],
226226
test: 'ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js',
227227
},
@@ -253,7 +253,7 @@ const defaultConfig = {
253253
// mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.0/napi-v3-win32-x64.tar.gz
254254
'*.s3.1amazonaws1.com': {
255255
'/sqlite3/.*': {
256-
redirect: 'npm.taobao.org/mirrors',
256+
redirect: 'npmmirror.com/mirrors',
257257
},
258258
},
259259
// 'packages.elastic.co': { '.*': { proxy: 'elastic.proxy.ustclug.org' } },

packages/core/src/config/remote_config.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"intercepts": {
1616
"github.com": {
1717
"^(/[\\w-.]+){2,}/?(\\?.*)?$": {
18-
"tampermonkeyScript": "https://gitee.com/wangliang181230/dev-sidecar-config/raw/main/tampermonkey.js",
19-
"script": "https://gitee.com/wangliang181230/dev-sidecar-config/raw/main/GithubEnhanced-High-Speed-Download.user.js"
18+
"tampermonkeyScript": "https://raw.giteeusercontent.com/wangliang181230/dev-sidecar-config/raw/main/tampermonkey.js",
19+
"script": "https://raw.giteeusercontent.com/wangliang181230/dev-sidecar-config/raw/main/GithubEnhanced-High-Speed-Download.user.js"
2020
},
2121
"^(/[^/]+){2}/releases/download/.*$": {
2222
"redirect": "ghp.ci/https://github.com",

packages/core/src/shell/shell.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,36 @@ class WindowsSystemShell extends SystemShell {
5959
ps.dispose()
6060
}
6161
} else {
62-
let compose = 'chcp 65001' // 'chcp 65001 '
62+
await childExecCmdWindows('chcp 65001', args)
63+
let ret
6364
for (const cmd of cmds) {
64-
compose += ` && ${cmd}`
65+
ret = await childExecCmdWindows(cmd, args)
6566
}
66-
// compose += '&& exit'
67-
return await childExec(compose, args)
67+
return ret
6868
}
6969
}
7070
}
7171

72+
function childExecCmdWindows (cmd, options = {}) {
73+
return new Promise((resolve, reject) => {
74+
const execOptions = { ...options }
75+
delete execOptions.type
76+
delete execOptions.printErrorLog
77+
78+
log.info('shell:', cmd)
79+
childProcess.execFile('cmd.exe', ['/d', '/s', '/c', cmd], execOptions, (error, stdout, stderr) => {
80+
if (error) {
81+
if (options.printErrorLog !== false) {
82+
log.error('cmd 命令执行错误:\n===>\ncommands:', cmd, '\n error:', error, '\n<===')
83+
}
84+
reject(new Error(stderr))
85+
} else {
86+
resolve(stdout.replace('Active code page: 65001\r\n', ''))
87+
}
88+
})
89+
})
90+
}
91+
7292
function childExec (composeCmds, options = {}) {
7393
return new Promise((resolve, reject) => {
7494
log.info('shell:', composeCmds)

packages/core/test/requestTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const request = require('request')
33

44
const options = {
55
url: 'https://raw.githubusercontent.com/docmirror/dev-sidecar/refs/heads/master/packages/core/src/config/remote_config.json5',
6-
// url: 'https://gitee.com/wangliang181230/dev-sidecar-config/raw/main/remote_config.json',
6+
// url: 'https://raw.giteeusercontent.com/wangliang181230/dev-sidecar-config/raw/main/remote_config.json',
77
servername: 'baidu.com',
88
agent: new HttpsAgent({
99
keepAlive: true,

packages/gui/README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,7 @@
22

33
## Project setup
44

5-
```
6-
yarn install
7-
```
8-
9-
### Compiles and hot-reloads for development
10-
11-
```
12-
yarn serve
13-
```
14-
15-
### Compiles and minifies for production
16-
17-
```
18-
yarn build
19-
```
20-
21-
### Lints and fixes files
22-
23-
```
24-
yarn lint
25-
```
5+
You should always refer to the [main README](../../README.md) for instructions on how to set up the project.
266

277
### Customize configuration
288

packages/gui/src/view/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export default {
6868
}
6969
})
7070
},
71+
isPreRelease () {
72+
const version = this.info && this.info.version
73+
return typeof version === 'string' && version.includes('-')
74+
},
7175
},
7276
7377
created() {

0 commit comments

Comments
 (0)