@mmmbuto/nexuscrew 0.9.62 → 0.9.63
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/CHANGELOG.md +8 -0
- package/frontend/dist/assets/index-D1cTtNED.css +32 -0
- package/frontend/dist/assets/index-maPH0v_e.js +169 -0
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/version.json +1 -1
- package/lib/tmux/list.js +16 -5
- package/package.json +1 -1
- package/frontend/dist/assets/index-Cq8wINIe.js +0 -169
- package/frontend/dist/assets/index-fCIoVxeq.css +0 -32
package/frontend/dist/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<meta name="apple-mobile-web-app-title" content="NexusCrew" />
|
|
12
12
|
<link rel="manifest" href="/manifest.json" />
|
|
13
13
|
<title>NexusCrew</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-maPH0v_e.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D1cTtNED.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.9.
|
|
1
|
+
{"version":"0.9.63"}
|
package/lib/tmux/list.js
CHANGED
|
@@ -62,6 +62,15 @@ function isNoTmuxServerError(raw) {
|
|
|
62
62
|
|| /error connecting to .*(?:No such file or directory|Connection refused)/i.test(message);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// NexusCrew starts tmux with `set -s exit-empty off`, so a live server with
|
|
66
|
+
// no sessions answers `list-panes -a` with "no current target" (not "no
|
|
67
|
+
// server running"): that is an empty inventory, not an error — otherwise the
|
|
68
|
+
// node would drop out of the fleet whenever its last session closes. This
|
|
69
|
+
// applies to list-panes ONLY: the other commands keep rejecting it.
|
|
70
|
+
function isNoCurrentTargetError(message) {
|
|
71
|
+
return /no current target/i.test(String(message || ''));
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
function setSessionVisibility(tmuxBin = 'tmux', name, technical = false) {
|
|
66
75
|
return new Promise((resolve, reject) => {
|
|
67
76
|
if (typeof name !== 'string' || !/^[\w.@%:+-]{1,128}$/.test(name) || name.startsWith('-')) {
|
|
@@ -88,8 +97,9 @@ function listPanes(tmuxBin = 'tmux') {
|
|
|
88
97
|
return new Promise((resolve, reject) => {
|
|
89
98
|
execFile(tmuxBin, ['list-panes', '-a', '-F', PANES_FMT], (err, stdout, stderr) => {
|
|
90
99
|
if (err) {
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
const message = String(stderr || err.message);
|
|
101
|
+
if (isNoTmuxServerError(message) || isNoCurrentTargetError(message)) return resolve('');
|
|
102
|
+
return reject(new Error(`tmux list-panes failed: ${message}`));
|
|
93
103
|
}
|
|
94
104
|
resolve(stdout);
|
|
95
105
|
});
|
|
@@ -144,8 +154,9 @@ function listFleetPanes(tmuxBin = 'tmux') {
|
|
|
144
154
|
return new Promise((resolve, reject) => {
|
|
145
155
|
execFile(tmuxBin, ['list-panes', '-a', '-F', FLEET_PANES_FMT], (err, stdout, stderr) => {
|
|
146
156
|
if (err) {
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
const message = String(stderr || err.message);
|
|
158
|
+
if (isNoTmuxServerError(message) || isNoCurrentTargetError(message)) return resolve('');
|
|
159
|
+
return reject(new Error(`tmux list-panes failed: ${message}`));
|
|
149
160
|
}
|
|
150
161
|
resolve(stdout);
|
|
151
162
|
});
|
|
@@ -166,6 +177,6 @@ function attachedClients(tmuxBin = 'tmux', session) {
|
|
|
166
177
|
}
|
|
167
178
|
|
|
168
179
|
module.exports = {
|
|
169
|
-
parsePaneTitle, parseSessions, isNoTmuxServerError, listSessions, listPanes, attachedClients, setSessionVisibility, FMT,
|
|
180
|
+
parsePaneTitle, parseSessions, isNoTmuxServerError, isNoCurrentTargetError, listSessions, listPanes, attachedClients, setSessionVisibility, FMT,
|
|
170
181
|
FLEET_PANES_FMT, sessionsFromPanes, listFleetPanes,
|
|
171
182
|
};
|