jsir 2.6.13 → 2.6.14
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/cmd/oaa.js +12 -13
- package/deps/room.js +8 -3
- package/package.json +1 -1
package/cmd/oaa.js
CHANGED
|
@@ -198,6 +198,7 @@ function checkWorkspaces() {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
async function start() {
|
|
201
|
+
terminalTitle()
|
|
201
202
|
cleanFileLocks();
|
|
202
203
|
|
|
203
204
|
setting.wrapperInput = wrapperInput;
|
|
@@ -420,9 +421,7 @@ function _nextLine(callback, promptStr, hidden, resolve, end, isText) {
|
|
|
420
421
|
return;
|
|
421
422
|
}
|
|
422
423
|
initRl(callback, promptStr, hidden);
|
|
423
|
-
if (callback
|
|
424
|
-
terminalTitle()
|
|
425
|
-
} else {
|
|
424
|
+
if (callback !== wrapperInput) {
|
|
426
425
|
_haveWrapperInput = false
|
|
427
426
|
}
|
|
428
427
|
end = trim(end)
|
|
@@ -485,7 +484,11 @@ async function nextText(callback, end, hidden) {
|
|
|
485
484
|
}
|
|
486
485
|
|
|
487
486
|
async function save(args) {
|
|
488
|
-
let
|
|
487
|
+
let pair = parseUniqueName(args.join(' '));
|
|
488
|
+
if (pair[0] && !setting.workspaceMap[pair[0]]) {
|
|
489
|
+
throw 'invalid name'
|
|
490
|
+
}
|
|
491
|
+
let uniqueName = toUniqueName(toJsirFileName(pair[1]), pair[0])
|
|
489
492
|
let path = getFullPath(uniqueName)
|
|
490
493
|
if (fs.existsSync(path)) {
|
|
491
494
|
console.warn(`${path} already exist`)
|
|
@@ -2021,12 +2024,6 @@ function getArgComments(argDef, showShort = false) {
|
|
|
2021
2024
|
let item = warnStr(k) + (shortMap[k] ? ` ${warnStr(shortMap[k])}`:'') + (argDef[k] ? ` ${argDef[k]}`:'')
|
|
2022
2025
|
comments.push(item)
|
|
2023
2026
|
}
|
|
2024
|
-
comments[0] = comments[0]
|
|
2025
|
-
if (comments.length > 1) {
|
|
2026
|
-
for(let i = 1; i< comments.length; i++) {
|
|
2027
|
-
comments[i] = comments[i]
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
2027
|
}
|
|
2031
2028
|
return comments
|
|
2032
2029
|
}
|
|
@@ -2249,20 +2246,22 @@ function parseArgDef(inputString) {
|
|
|
2249
2246
|
result[s1] = '';
|
|
2250
2247
|
}
|
|
2251
2248
|
}
|
|
2249
|
+
let tempResult = {}
|
|
2252
2250
|
for (let key of Object.keys(result)) {
|
|
2253
2251
|
let comment = result[key];
|
|
2254
2252
|
let defaultValStr = ''
|
|
2255
2253
|
if (key.indexOf("=") !== -1) {
|
|
2256
|
-
delete result[key];
|
|
2257
2254
|
let ss = key.split('=').map(trim);
|
|
2258
2255
|
key = ss[0]
|
|
2259
2256
|
defaultValStr = ss[1]
|
|
2260
2257
|
}
|
|
2261
2258
|
if (defaultValStr) {
|
|
2262
|
-
|
|
2259
|
+
tempResult[key] = ['<' + warnStr(defaultValStr) + '>', comment].join(' ')
|
|
2260
|
+
} else {
|
|
2261
|
+
tempResult[key] = comment
|
|
2263
2262
|
}
|
|
2264
2263
|
}
|
|
2265
|
-
return
|
|
2264
|
+
return tempResult;
|
|
2266
2265
|
}
|
|
2267
2266
|
|
|
2268
2267
|
function getArgDef(text, uniqueName) {
|
package/deps/room.js
CHANGED
|
@@ -113,7 +113,12 @@ async function initNodes() {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
} else {
|
|
116
|
-
let resp =
|
|
116
|
+
let resp = '';
|
|
117
|
+
try {
|
|
118
|
+
resp = await e(`${tailscalePath} status`);
|
|
119
|
+
} catch (e) {
|
|
120
|
+
debug("initNodes", e)
|
|
121
|
+
}
|
|
117
122
|
for (let line of resp.split("\n").map(trim)) {
|
|
118
123
|
let offline = line.indexOf('offline') !== -1
|
|
119
124
|
let ss = line.split(/\s+/);
|
|
@@ -248,8 +253,8 @@ async function _syncSetting(room) {
|
|
|
248
253
|
setting.services = {}
|
|
249
254
|
setting.serviceFns = {}
|
|
250
255
|
for (const room of setting.rooms) {
|
|
251
|
-
if (
|
|
252
|
-
continue
|
|
256
|
+
if (!room.active) {
|
|
257
|
+
continue;
|
|
253
258
|
}
|
|
254
259
|
for (const pid of Object.keys(room.jsirs || {})) {
|
|
255
260
|
let jsir = room.jsirs[pid];
|