Skip to content

Commit 4683f57

Browse files
committed
v0.1.2 update
added check for existing output file before chrome is launched
1 parent 0a72a91 commit 4683f57

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const fs: typeof fsType = require('fs');
4646
// Special case: -v or --version with no other parameters
4747
const onlyVersion = (args.length === 1 && (args[0] === '-v' || args[0] === '--version'));
4848
if (hasFlag('version') || onlyVersion) {
49-
console.log('v0.1.1');
49+
console.log('v0.1.2');
5050
return;
5151
}
5252

@@ -86,6 +86,10 @@ const fs: typeof fsType = require('fs');
8686
// Browser setup
8787
const startTime = Date.now();
8888
log("Started: " + new Date().toLocaleString());
89+
if (!force && outputFile !== '-' && fs.existsSync(outputFile)) {
90+
console.error(`Output file '${outputFile}' already exists. Use --force or -f to overwrite.`);
91+
process.exit(2);
92+
}
8993
log(`Navigating to ${url}`);
9094
const launchOpts: puppeteerType.LaunchOptions & Record<string, any> = headless
9195
? { headless: true }

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphics-error-scraper",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Scrapes a WebCTRL system to look for graphics errors.",
55
"license": "BSD-3-Clause",
66
"author": "Cameron Vogt",

0 commit comments

Comments
 (0)