Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html is generated in the default location even if an output directory is specified #4

Closed
dhillonks opened this issue Sep 17, 2021 · 1 comment

Comments

@dhillonks
Copy link
Contributor

The readme as well as the help section in the tool gives the user an option to use -o or --output. So, if the user uses that and specifies a specific location, the tool should generate the web pages in that directory.

For instance, I tried running:

 node server.js -i .\Sherlock-Holmes-Selected-Stories\ -o "output_dir"

It should store the results in output_dir, however it still stores the results in the default ./dist. It seems like ./dist is hardcoded:

My-First-SSG/server.js

Lines 30 to 43 in ae06d02

// Check ./dist folder
if(fs.existsSync("./dist")){
fs.rmdirSync("./dist",{recursive: true} , err=>{
if(err) throw err;
});
fs.mkdir("./dist", err=>{
if(err) throw err;
});
}
else{
fs.mkdir("./dist", err=>{
if(err) throw err;
});
}

@DerekJxy
Copy link
Owner

Hmm.. yeah I set that place all output into a ./dist folder by default. And I didn't make a feature for the output path which is an optional feature so far. But your idea is good, I should make that feature as well. 👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants