josephrcox / easy-reddit-downloader

Simple headless Reddit post downloader
MIT License
70 stars 9 forks source link

user_config.json in index.js Line 11? #51

Closed Jay4242 closed 1 year ago

Jay4242 commented 1 year ago

On line 11 of index.js ( https://github.com/josephrcox/easy-reddit-downloader/blob/main/index.js#L11 ) should that be, let config = require('./user_config.json');

Instead of the let config = require('./user_config_DEFAULT.json'); ?

I was trying to use the user_config.json and noticed it kept sending me to the prompt even when testingMode was set to 'true.'

Was a minor change of course, just something I noticed.

Thanks.

josephrcox commented 1 year ago

Great catch. There is a reason for this code, but you did find a mistake that I just fixed here https://github.com/josephrcox/easy-reddit-downloader/releases/tag/v0.1.8.1. You can just swap in the new index.js and package.json and you'll be good I think.

The reason for let config = require('./user_config_DEFAULT.json');: When a new user downloads the downloader, they do not have a user_config.json. They do, however, have a default file that has the default settings. On first launch, the program uses the default values and creates the user_config.json file so that the user can customize their settings.

If the user gets the user_config.json messed up, instead of opening an issue or redownloading the repo, they can delete user_config.json and use the defaults. Or they can just copy and paste the default JSON object over.

Let me know if you have any questions!