Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Automatically create specified output folder and fix donation numbers going on longer than two decimal places #5

Merged
merged 3 commits into from
Feb 20, 2020

Conversation

legoandmars
Copy link
Contributor

No description provided.

Copy link
Owner

@vignedev vignedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request!

I'd like you to change one thing before merging though, regarding the fs.existsSync: it can be omitted if we use fs.mkdirSync with { recursive: true } option.

index.js Outdated
Comment on lines 78 to 80
if(!(fs.existsSync(path.resolve(process.cwd(), argv.output || '')))){
fs.mkdirSync(path.resolve(process.cwd(), argv.output || ''));
}
Copy link
Owner

@vignedev vignedev Feb 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!(fs.existsSync(path.resolve(process.cwd(), argv.output || '')))){
fs.mkdirSync(path.resolve(process.cwd(), argv.output || ''));
}
fs.mkdirSync(path.resolve(process.cwd(), argv.output || ''), { recursive: true });

This will create parent directories as well and won't throw exceptions if the folder already exists. With this it shouldn't be necessary to check whether the directory exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@vignedev vignedev merged commit 217d954 into vignedev:master Feb 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants