summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsnappy.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/snappy.js b/snappy.js
index 59ced51..96fd5a6 100755
--- a/snappy.js
+++ b/snappy.js
@@ -26,7 +26,8 @@ if(argv.h){
["-w", "<Windows Size, Default:1280x720>"],
["-v", "<Check if screenshots are blank and output to...>"],
["-t", "Add additional delay to screenshots (Seconds)"],
- ["-p", "<SOCKS5 Proxy Port>"]
+ ["-p", "<SOCKS5 Proxy Port>"],
+ ["-o", "<Image Output Directory (default: './')>"]
];
process.stdout.write(colors.green(`Possible Arguments:\n`));
@@ -71,6 +72,13 @@ if(argv.p){
process.stdout.write(colors.yellow(`\r${emotes['ck']} Traffic will use SOCKS5 proxy on port `) + colors.green(`${argv.p}\n`));
}
+// Check if there is a custom output directory
+if(argv.o){
+ process.stdout.write(colors.yellow(`\r${emotes['ck']} Set output directory to `) + colors.green(`${argv.o}\n`));
+} else {
+ argv.o = "./";
+}
+
// MODULE LOADING SECTION DONE
console.log(colors.cyan(" ..................... "));
@@ -137,7 +145,7 @@ async function run() {
await page.goto(site, { waitUntil: 'networkidle2' }).then(async () => {
let userTimeout = parseInt(argv.t);
await timeout(isNaN(userTimeout)?0:userTimeout*1000);
- await page.screenshot({path: imageName}).then(async () => {
+ await page.screenshot({path: argv.o + imageName}).then(async () => {
if(!argv.v)
return;
const res = await verifyImage(imageName);