Skip to content

Commit cd4b7f7

Browse files
committed
fix: Fixed prompt from users to exclude files
1 parent 34300fb commit cd4b7f7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
This package can be installed globally or locally using:
1919
```sh
20-
$ npm install @futura-dev/contribuiting-gen
20+
$ npm install @futura-dev/contributing-gen
2121
```
2222

2323
Now you can use our CLI issuing:
2424
```sh
25-
$ npx @futura-dev/contribuiting-gen generate
25+
$ npx @futura-dev/contributing-gen generate
2626
```
2727

2828
The CLI asks you to fill the points needed to generate all the files.

src/commands/generate.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ export const generate = async (): Promise<void> => {
9494

9595
if (contributingMd) writeFile(`${process.env.NODE_ENV === 'development' ? 'out' : ''}`, contributingMd, "CONTRIBUTING.md");
9696
if (codeOfConductMd) writeFile(`${process.env.NODE_ENV === 'development' ? 'out' : ''}`, codeOfConductMd, "CODE_OF_CONDUCT.md");
97-
if (codeOfConductMd) writeFile(`${process.env.NODE_ENV === 'development' ? 'out' : ''}`, licenseMd, "LICENSE");
98-
if (codeOfConductMd) writeFile(`${process.env.NODE_ENV === 'development' ? 'out' : ''}`, readmeMd, "README.md");
97+
if (licenseMd) writeFile(`${process.env.NODE_ENV === 'development' ? 'out' : ''}`, licenseMd, "LICENSE");
98+
if (readmeMd) writeFile(`${process.env.NODE_ENV === 'development' ? 'out' : ''}`, readmeMd, "README.md");
9999

100100
console.log('Contribution files successfully created 🚀')
101101
return Promise.resolve()

src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class ContributingGen {
2222
* Generate markdown output for the contribution guidelines.
2323
*/
2424
generateContributing(specs: Specs) {
25-
if (!specs.contributing.generate) return "";
25+
if (!specs.contributing.generate) return null;
2626
specs.project.repoUrl = specs.project.repoUrl.replace(/\/\s*$/, "");
2727
return this.contributingCompiled(specs);
2828
}
@@ -31,23 +31,23 @@ export class ContributingGen {
3131
* Generate markdown output for the code of conduct.
3232
*/
3333
generateCodeOfConduct(specs: Specs) {
34-
if (!specs.codeOfConduct.generate) return "";
34+
if (!specs.codeOfConduct.generate) return null;
3535
return this.codeOfConductCompiled(specs);
3636
}
3737

3838
/**
3939
* Generate markdown output for the license.
4040
*/
4141
generateLicense(specs: Specs) {
42-
if (!specs.license.generate) return "";
42+
if (!specs.license.generate) return null;
4343
return this.licenseCompiled(specs);
4444
}
4545

4646
/**
4747
* Generate markdown output for the readme.
4848
*/
4949
generateReadme(specs: Specs) {
50-
if (!specs.readme.generate) return "";
50+
if (!specs.readme.generate) return null;
5151
return this.readmeCompiled(specs);
5252
}
5353
}

0 commit comments

Comments
 (0)