@nu-art/build-and-install 0.204.30 → 0.204.31
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/phases/phases.js +15 -6
package/package.json
CHANGED
package/phases/phases.js
CHANGED
|
@@ -618,51 +618,59 @@ exports.Phase_Launch = {
|
|
|
618
618
|
.setUID(pkg.name).debug()
|
|
619
619
|
.append(`array=($(lsof -ti:${allPorts.join(',')}))`)
|
|
620
620
|
.append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
|
|
621
|
+
.append('echo ')
|
|
621
622
|
.execute();
|
|
623
|
+
const KILL_CONFIRM_LOG = `KILL PROCESS`;
|
|
622
624
|
const PROXY_PID_PROCESS = 'PROXY_PID_PROCESS';
|
|
623
625
|
let proxyPid;
|
|
624
626
|
const proxyPidProcessor = (stdout) => {
|
|
625
627
|
var _a;
|
|
628
|
+
if (stdout.includes(KILL_CONFIRM_LOG))
|
|
629
|
+
return proxyCommando.close();
|
|
626
630
|
const pid = (_a = stdout.match(new RegExp(`${PROXY_PID_PROCESS}=(\\d+)`))) === null || _a === void 0 ? void 0 : _a[1];
|
|
627
631
|
if (!(0, ts_common_1.exists)(pid))
|
|
628
632
|
return;
|
|
629
633
|
proxyPid = +pid;
|
|
630
|
-
proxyCommando.removeStdoutProcessor(proxyPidProcessor);
|
|
634
|
+
// proxyCommando.removeStdoutProcessor(proxyPidProcessor);
|
|
631
635
|
};
|
|
632
636
|
const proxyCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
|
|
633
637
|
.setUID(pkg.name)
|
|
634
638
|
.cd(pkg.path)
|
|
635
639
|
.addStdoutProcessor(proxyPidProcessor)
|
|
636
|
-
.
|
|
640
|
+
.append('echo ZE ZEVEL1')
|
|
637
641
|
.append('ts-node src/main/proxy.ts &')
|
|
638
642
|
.append('pid=$!')
|
|
639
643
|
.append(`echo "${PROXY_PID_PROCESS}=\${pid}"`)
|
|
640
|
-
.append(`wait \$pid`)
|
|
644
|
+
.append(`wait \$pid`)
|
|
645
|
+
.append(`echo "${KILL_CONFIRM_LOG} \${pid}"`);
|
|
641
646
|
const EMULATOR_PID_PROCESS = 'EMULATOR_PID_PROCESS';
|
|
642
647
|
let emulatorPid;
|
|
643
648
|
const emulatorPidProcessor = (stdout) => {
|
|
644
649
|
var _a;
|
|
650
|
+
if (stdout.includes(KILL_CONFIRM_LOG))
|
|
651
|
+
return emulatorCommando.close();
|
|
645
652
|
const pid = (_a = stdout.match(new RegExp(`${EMULATOR_PID_PROCESS}=(\\d+)`))) === null || _a === void 0 ? void 0 : _a[1];
|
|
646
653
|
if (!(0, ts_common_1.exists)(pid))
|
|
647
654
|
return;
|
|
648
655
|
emulatorPid = +pid;
|
|
649
|
-
emulatorCommando.removeStdoutProcessor(emulatorPidProcessor);
|
|
650
656
|
};
|
|
651
657
|
const emulatorCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
|
|
652
658
|
.setUID(pkg.name)
|
|
653
659
|
.cd(pkg.path)
|
|
654
660
|
.addStdoutProcessor(emulatorPidProcessor)
|
|
655
|
-
.
|
|
661
|
+
.append('echo ZE ZEVEL2')
|
|
656
662
|
.append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''} &`)
|
|
657
663
|
.append('pid=$!')
|
|
658
664
|
.append(`echo "${EMULATOR_PID_PROCESS}=\${pid}"`)
|
|
659
|
-
.append(`wait \$pid`)
|
|
665
|
+
.append(`wait \$pid`)
|
|
666
|
+
.append(`echo "${KILL_CONFIRM_LOG} \${pid}"`);
|
|
660
667
|
await proxyCommando.execute();
|
|
661
668
|
await emulatorCommando.execute();
|
|
662
669
|
runningAppsLogs.addOnTerminateCallback(async () => {
|
|
663
670
|
console.log('HERE');
|
|
664
671
|
await emulatorCommando.gracefullyKill(emulatorPid);
|
|
665
672
|
await proxyCommando.gracefullyKill(proxyPid);
|
|
673
|
+
runningAppsLogs.unregisterApp(pkg.name);
|
|
666
674
|
});
|
|
667
675
|
return;
|
|
668
676
|
}
|
|
@@ -673,6 +681,7 @@ exports.Phase_Launch = {
|
|
|
673
681
|
return nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
|
|
674
682
|
.setUID(pkg.name).debug()
|
|
675
683
|
.cd(pkg.path)
|
|
684
|
+
.append('echo ZE ZEVEL3')
|
|
676
685
|
.append(`array=($(lsof -ti:${[pkg.envConfig.hostingPort].join(',')}))`)
|
|
677
686
|
.append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
|
|
678
687
|
.append(`nvm use`)
|