@pixui-dev/pxw 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/devops.js +9 -3
- package/package.json +1 -1
package/config/devops.js
CHANGED
|
@@ -70,9 +70,11 @@ module.exports.setupDevops = async function (server, app) {
|
|
|
70
70
|
let referrer = url.searchParams.get('referrer')?.substring(1);
|
|
71
71
|
console.log('ws connection', url.pathname, referrer);
|
|
72
72
|
conn.send(JSON.stringify({ type: 'ipList', data: util.getLocalIP() }));
|
|
73
|
-
{
|
|
73
|
+
try {
|
|
74
74
|
let br = cp.execSync('git branch --show-current', { stdio: 'pipe', cwd: rootDir, windowsHide: true });
|
|
75
75
|
conn.send(JSON.stringify({ type: 'setDirResult', id: 'pxw', value: rootDir, result: br.toString() }));
|
|
76
|
+
} catch(e) {
|
|
77
|
+
console.log('git branch error: ', e)
|
|
76
78
|
}
|
|
77
79
|
// console.log(url.pathname, url.searchParams);
|
|
78
80
|
if (url.pathname == '/notify') {
|
|
@@ -316,8 +318,12 @@ module.exports.setupDevops = async function (server, app) {
|
|
|
316
318
|
value = rootDir;
|
|
317
319
|
}
|
|
318
320
|
if (value && id in { pxw: 1, pxkit: 1, pxembed: 1, pxapp: 1, unreal: 1 }) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
try{
|
|
322
|
+
let br = cp.execSync('git branch --show-current', { stdio: 'pipe', cwd: value, windowsHide: true });
|
|
323
|
+
devopsConn?.send(JSON.stringify({ type: 'setDirResult', id, value, result: br.toString() }));
|
|
324
|
+
}catch(e) {
|
|
325
|
+
console.log('setDir git branch error: ', e)
|
|
326
|
+
}
|
|
321
327
|
}
|
|
322
328
|
else if (id in { java: 1 }) {
|
|
323
329
|
// let ver = cp.spawnSync('java', ['-version'], { stdio: 'pipe' }).stderr.toString().split('\n')[0];
|