mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +00:00
Livepush: Fix process not exiting on "Connection to device lost"
Resolves: #1828 Change-type: patch
This commit is contained in:
parent
309b1ba6a0
commit
5497835728
@ -274,6 +274,8 @@ export async function deployToDevice(opts: DeviceDeployOptions): Promise<void> {
|
|||||||
globalLogger.logLivepush('Watching for file changes...');
|
globalLogger.logLivepush('Watching for file changes...');
|
||||||
globalLogger.outputDeferredMessages();
|
globalLogger.outputDeferredMessages();
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
|
|
||||||
|
livepush.close();
|
||||||
} else {
|
} else {
|
||||||
if (opts.detached) {
|
if (opts.detached) {
|
||||||
return;
|
return;
|
||||||
|
@ -290,6 +290,16 @@ export class LivepushManager {
|
|||||||
return monitor;
|
return monitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public close() {
|
||||||
|
for (const container of Object.values(this.containers)) {
|
||||||
|
container.monitor.close().catch((err) => {
|
||||||
|
if (process.env.DEBUG) {
|
||||||
|
this.logger.logDebug(`chokidar.close() ${err.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static preprocessDockerfile(content: string): string {
|
public static preprocessDockerfile(content: string): string {
|
||||||
return new Dockerfile(content).generateLiveDockerfile();
|
return new Dockerfile(content).generateLiveDockerfile();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user