Skip to content

Commit

Permalink
Add debug option to see what the browser is doing
Browse files Browse the repository at this point in the history
  • Loading branch information
nibble-4bits committed Nov 29, 2020
1 parent c85c385 commit 9d87b3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codewars-solutions-scraper",
"version": "1.0.4",
"version": "1.0.5",
"description": "A scraper that gets the solutions of all of the CodeWars katas you have solved",
"main": "src/main.js",
"bin": {
Expand Down
4 changes: 3 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { exit } = require('process');
const { version: packageVersion } = require('../package.json');
const extensions = require('./extensions.js');

const DEBUG_FLAG = false;
let DEBUG_FLAG = false;
const CODEWARS_BASE_URL = 'https://www.codewars.com';
const DEFAULT_OUTPUT_DIR_PATH = path.join(homedir(), 'my_codewars_solutions');

Expand Down Expand Up @@ -52,6 +52,7 @@ async function main() {
.option('-g, --github', 'use GitHub login credentials')
.option('-o, --output <path>', 'path to the output directory where solutions will be saved', DEFAULT_OUTPUT_DIR_PATH)
.option('-v, --verbose', 'explain what is being done')
.option('-d, --debug', 'run the scraper in debug mode (will make browser window appear to see what is being done)')
.requiredOption('-u, --username <username>', 'your CodeWars username')
.requiredOption('-e, --email <email>', 'your GitHub or CodeWars account email')
.requiredOption('-p, --password <password>', 'your GitHub or CodeWars account password')
Expand All @@ -69,6 +70,7 @@ async function main() {

log.setDefaultLevel('SILENT');
if (program.verbose) log.setLevel('INFO');
if (program.debug) DEBUG_FLAG = true;

log.info('Launching Puppeteer instance.');
const browser = await puppeteer.launch({
Expand Down

0 comments on commit 9d87b3d

Please sign in to comment.