@xaidenlabs/uso 1.1.16 → 1.1.18
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/package.json +1 -1
- package/src/commands/workflow.js +19 -6
package/package.json
CHANGED
package/src/commands/workflow.js
CHANGED
|
@@ -114,6 +114,8 @@ const runElevatedWithProgress = (command, args = []) => {
|
|
|
114
114
|
|
|
115
115
|
// 4. Stream Log to Main Console
|
|
116
116
|
let lastSize = 0;
|
|
117
|
+
const spin = spinner('Waiting for output from elevated terminal...').start();
|
|
118
|
+
|
|
117
119
|
const checkInterval = setInterval(() => {
|
|
118
120
|
try {
|
|
119
121
|
if (!fs.existsSync(progressFile)) return;
|
|
@@ -125,17 +127,28 @@ const runElevatedWithProgress = (command, args = []) => {
|
|
|
125
127
|
fs.readSync(fd, buffer, 0, buffer.length, lastSize);
|
|
126
128
|
fs.closeSync(fd);
|
|
127
129
|
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
const rawText = buffer.toString('utf8');
|
|
131
|
+
const displayText = rawText
|
|
132
|
+
.replace(/USO_AC_SUCCESS/g, '')
|
|
133
|
+
.replace(/USO_AC_FAILURE/g, '');
|
|
134
|
+
|
|
135
|
+
// Stop spinner to print logs cleanly
|
|
136
|
+
spin.stop();
|
|
137
|
+
process.stdout.write(displayText);
|
|
138
|
+
|
|
131
139
|
lastSize = stats.size;
|
|
132
140
|
|
|
133
|
-
if (
|
|
141
|
+
if (rawText.includes("USO_AC_SUCCESS")) {
|
|
134
142
|
clearInterval(checkInterval);
|
|
143
|
+
spin.succeed('Elevated process completed successfully.');
|
|
135
144
|
resolve();
|
|
136
|
-
} else if (
|
|
145
|
+
} else if (rawText.includes("USO_AC_FAILURE")) {
|
|
137
146
|
clearInterval(checkInterval);
|
|
138
|
-
|
|
147
|
+
spin.fail('Elevated process reported failure.');
|
|
148
|
+
resolve();
|
|
149
|
+
} else {
|
|
150
|
+
// Restart spinner with "Building..." status since we are receiving data
|
|
151
|
+
spin.start('Building...');
|
|
139
152
|
}
|
|
140
153
|
}
|
|
141
154
|
} catch (e) {
|