@holochain/hc-spin 0.100.3 → 0.100.4

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.
@@ -11792,7 +11792,7 @@ const menu = electron.Menu.buildFromTemplate([
11792
11792
  ]);
11793
11793
  const rustUtils = require("@holochain/hc-spin-rust-utils");
11794
11794
  const cli = new commander.Command();
11795
- cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`0.100.3 (for holochain 0.1.x)`).argument(
11795
+ cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`0.100.4 (for holochain 0.1.x)`).argument(
11796
11796
  "<path>",
11797
11797
  "Path to .webhapp or .happ file to launch. If a .happ file is passed, either a UI path must be specified via --ui-path or a port pointing to a localhost server via --ui-port"
11798
11798
  ).option(
@@ -11978,14 +11978,17 @@ electron.app.whenReady().then(async () => {
11978
11978
  };
11979
11979
  }
11980
11980
  });
11981
- electron.app.on("window-all-closed", () => {
11982
- electron.app.quit();
11983
- });
11984
11981
  electron.app.on("quit", () => {
11982
+ cleanup();
11983
+ });
11984
+ function cleanup() {
11985
+ console.log("[hc-spin]: cleaning up.");
11985
11986
  fs.writeFileSync(
11986
11987
  path.join(DATA_ROOT_DIR, ".abandoned"),
11987
11988
  "I'm not in use anymore by an active hc-spin process."
11988
11989
  );
11989
- SANDBOX_PROCESSES.forEach((handle) => handle.kill());
11990
+ SANDBOX_PROCESSES.forEach((handle) => {
11991
+ handle.kill("SIGINT");
11992
+ });
11990
11993
  childProcess__namespace.spawnSync("hc", ["sandbox", "clean"]);
11991
- });
11994
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/hc-spin",
3
- "version": "0.100.3",
3
+ "version": "0.100.4",
4
4
  "description": "CLI to run Holochain aps during development.",
5
5
  "author": "matthme",
6
6
  "homepage": "https://developer.holochain.org",
package/src/main/index.ts CHANGED
@@ -28,7 +28,7 @@ const cli = new Command();
28
28
  cli
29
29
  .name('hc-spin')
30
30
  .description('CLI to run Holochain apps during development.')
31
- .version(`0.100.3 (for holochain 0.1.x)`)
31
+ .version(`0.100.4 (for holochain 0.1.x)`)
32
32
  .argument(
33
33
  '<path>',
34
34
  'Path to .webhapp or .happ file to launch. If a .happ file is passed, either a UI path must be specified via --ui-path or a port pointing to a localhost server via --ui-port',
@@ -301,19 +301,19 @@ app.whenReady().then(async () => {
301
301
  // });
302
302
  });
303
303
 
304
- // Quit when all windows are closed, except on macOS. There, it's common
305
- // for applications and their menu bar to stay active until the user quits
306
- // explicitly with Cmd + Q.
307
- app.on('window-all-closed', () => {
308
- app.quit();
304
+ app.on('quit', () => {
305
+ cleanup();
309
306
  });
310
307
 
311
- app.on('quit', () => {
308
+ function cleanup() {
309
+ console.log('[hc-spin]: cleaning up.');
312
310
  fs.writeFileSync(
313
311
  path.join(DATA_ROOT_DIR, '.abandoned'),
314
312
  "I'm not in use anymore by an active hc-spin process.",
315
313
  );
316
314
  // clean up sandboxes
317
- SANDBOX_PROCESSES.forEach((handle) => handle.kill());
315
+ SANDBOX_PROCESSES.forEach((handle) => {
316
+ handle.kill('SIGINT');
317
+ });
318
318
  childProcess.spawnSync('hc', ['sandbox', 'clean']);
319
- });
319
+ }