nstantpage-agent 0.8.13 → 0.8.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/dist/commands/start.js +6 -5
- package/package.json +1 -1
package/dist/commands/start.js
CHANGED
|
@@ -572,15 +572,16 @@ async function startStandbyMode(token, options, backendUrl, deviceId) {
|
|
|
572
572
|
devPort: 0,
|
|
573
573
|
onStartProject: async (pid, opts) => {
|
|
574
574
|
const isClean = opts?.clean === true;
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
575
|
+
const isLocalRepo = !!opts?.localFolderPath;
|
|
576
|
+
// If clean reset or LocalRepo re-start requested and project is already running, stop it first
|
|
577
|
+
if ((isClean || isLocalRepo) && activeProjects.has(pid)) {
|
|
578
|
+
console.log(chalk.yellow(` Stopping existing project ${pid} for ${isClean ? 'clean reset' : 'LocalRepo restart'}...`));
|
|
578
579
|
const existing = activeProjects.get(pid);
|
|
579
580
|
existing.tunnel.disconnect();
|
|
580
581
|
await existing.localServer.stop();
|
|
581
582
|
activeProjects.delete(pid);
|
|
582
|
-
// Wipe the project directory (only for non-LocalRepo)
|
|
583
|
-
if (!
|
|
583
|
+
// Wipe the project directory (only for clean non-LocalRepo)
|
|
584
|
+
if (isClean && !isLocalRepo) {
|
|
584
585
|
const projectDir = resolveProjectDir('.', pid);
|
|
585
586
|
if (fs.existsSync(projectDir)) {
|
|
586
587
|
console.log(chalk.gray(` Wiping project directory: ${projectDir}`));
|
package/package.json
CHANGED