fscr 6.1.2 → 6.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +10 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ const runCmd = async (app, argsList = []) => {
35
35
  };
36
36
  (async () => {
37
37
  clear();
38
- const argv = yargs(process.argv.slice(2)).usage("Usage: $0 <command> [options]")
38
+ const yargsInstance = yargs(process.argv.slice(2)).usage("Usage: $0 <command> [options]")
39
39
 
40
40
  /**
41
41
  * fsr
@@ -179,15 +179,14 @@ const runCmd = async (app, argsList = []) => {
179
179
  }).example(`${taskName("$0 generate")}`, `${textDescription("Generates a sample.fscripts.md you can use as template for your fscripts file")}`).command("toc", "Generate updated Table of Contents on top of the fscripts.md file", () => {}, async function (argv) {
180
180
  let mdFile = argv._[1];
181
181
  await generateToc(mdFile);
182
- }).example(`${taskName("$0 toc")}`, `${textDescription("Generate updated Table of Contents on top of the fscripts.md file")}`).argv;
183
- if (argv._.length === 0) {
184
- (async function () {
185
- const choice = await optionList();
186
- if (choice) {
187
- await runCmd("yarn", ["fsr", choice]);
188
- } else {
189
- console.log(chalk.green.bold("See you soon!"));
190
- }
191
- })();
182
+ }).example(`${taskName("$0 toc")}`, `${textDescription("Generate updated Table of Contents on top of the fscripts.md file")}`).help();
183
+ const argv = yargsInstance.argv;
184
+ if (argv && argv._ && argv._.length === 0) {
185
+ const choice = await optionList();
186
+ if (choice) {
187
+ await runCmd("yarn", ["fsr", choice]);
188
+ } else {
189
+ console.log(chalk.green.bold("See you soon!"));
190
+ }
192
191
  }
193
192
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fscr",
3
- "version": "6.1.2",
3
+ "version": "6.1.3",
4
4
  "description": "Runs the fscripts.md file",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",