Skip to content

Commit

Permalink
Explicitly exit the process on success
Browse files Browse the repository at this point in the history
This fixes an issue where the Vite dev server didn't stop properly.

Fixes #47.
  • Loading branch information
fwouts committed Jul 8, 2021
1 parent 3bdd9ac commit 571cbb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -9,7 +9,8 @@
},
"scripts": {
"build": "rimraf dist && rollup -c && chmod +x dist/lib/cli.js && cp package.json dist/",
"dev": "ts-node-dev src/cli.ts",
"dev": "ts-node src/cli.ts",
"dev:watch": "ts-node-dev src/cli.ts",
"release": "yarn build && cd dist && yarn publish --non-interactive"
},
"dependencies": {
Expand Down
6 changes: 4 additions & 2 deletions src/commands/shoot.ts
Expand Up @@ -22,8 +22,9 @@ export async function shootCommand(options: {
screenshotPaths = await config.shooter.shoot(`http://localhost:${port}`);
} catch (e) {
return fail(e.message);
} finally {
await stopRenderer();
}
await stopRenderer();
if (options.push) {
const git = simpleGit();
await git.addConfig("user.name", "🤖 Viteshot");
Expand All @@ -46,5 +47,6 @@ export async function shootCommand(options: {
info("✅ Screenshots have not changed.");
}
}
return info("All done.");
info("All done.");
return process.exit(0);
}

0 comments on commit 571cbb3

Please sign in to comment.