nightytidy 0.3.4 → 0.3.5
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
CHANGED
package/src/agent/cli-bridge.js
CHANGED
|
@@ -78,11 +78,17 @@ export class CliBridge {
|
|
|
78
78
|
_run(args, onOutput, opts = {}) {
|
|
79
79
|
return new Promise((resolve) => {
|
|
80
80
|
const binPath = path.resolve(import.meta.dirname, '../../bin/nightytidy.js');
|
|
81
|
-
const
|
|
81
|
+
const spawnOpts = {
|
|
82
82
|
cwd: this.projectDir,
|
|
83
83
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
84
84
|
windowsHide: true,
|
|
85
|
-
}
|
|
85
|
+
};
|
|
86
|
+
// On Windows, use shell mode to prevent a visible console window.
|
|
87
|
+
// cmd.exe inherits the parent's hidden console instead of creating a new one.
|
|
88
|
+
if (process.platform === 'win32') {
|
|
89
|
+
spawnOpts.shell = true;
|
|
90
|
+
}
|
|
91
|
+
const proc = spawn('node', [binPath, ...args], spawnOpts);
|
|
86
92
|
this.activeProcess = proc;
|
|
87
93
|
|
|
88
94
|
let stdout = '';
|
package/src/agent/keep-awake.js
CHANGED
|
@@ -25,7 +25,7 @@ export function acquireKeepAwake() {
|
|
|
25
25
|
keepAwakeProcess = spawn('powershell', [
|
|
26
26
|
'-NoProfile', '-WindowStyle', 'Hidden', '-Command',
|
|
27
27
|
`Add-Type -TypeDefinition 'using System; using System.Runtime.InteropServices; public class SleepPreventer { [DllImport("kernel32.dll")] public static extern uint SetThreadExecutionState(uint esFlags); }'; [SleepPreventer]::SetThreadExecutionState(0x80000001); while($true) { Start-Sleep -Seconds 3600 }`,
|
|
28
|
-
], { stdio: 'ignore', detached: false });
|
|
28
|
+
], { stdio: 'ignore', detached: false, windowsHide: true });
|
|
29
29
|
keepAwakeProcess.unref();
|
|
30
30
|
keepAwakeProcess.on('error', () => { keepAwakeProcess = null; });
|
|
31
31
|
debug('Sleep prevention acquired (Windows SetThreadExecutionState)');
|
package/src/agent/setup-flow.js
CHANGED
|
@@ -176,7 +176,12 @@ export async function setupAgent() {
|
|
|
176
176
|
|
|
177
177
|
console.log(chalk.bold('\nStep 4: Start agent'));
|
|
178
178
|
|
|
179
|
-
spawn(process.execPath, [BIN_PATH, 'agent'], {
|
|
179
|
+
spawn(process.execPath, [BIN_PATH, 'agent'], {
|
|
180
|
+
detached: true,
|
|
181
|
+
stdio: 'ignore',
|
|
182
|
+
windowsHide: true,
|
|
183
|
+
shell: process.platform === 'win32',
|
|
184
|
+
}).unref();
|
|
180
185
|
console.log(chalk.green(' Agent started'));
|
|
181
186
|
|
|
182
187
|
// ── Done ──────────────────────────────────────────────────────────────────
|