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

--force flag not working in v4.0.0 #103

Closed
michael-dickinson-sainsburys opened this issue Oct 13, 2020 · 1 comment · Fixed by #105
Closed

--force flag not working in v4.0.0 #103

michael-dickinson-sainsburys opened this issue Oct 13, 2020 · 1 comment · Fixed by #105
Labels
bug Something isn't working

Comments

@michael-dickinson-sainsburys

When reading and writing back to the same folder, the --force flag is required. Passing this at the end of the command does not seem to work in v4.0.0 (it worked in v3.6.5), instead, an error is output stating that the flag is required and then the tool aborts.

glossarify-md.conf.json:

{
  "$schema": "./node_modules/glossarify-md/conf.schema.json",
  "baseDir": "./",
  "outDir": "./",
  "glossaries": [
     { "file": "./GLOSSARY.md" }
  ],
  "ignoreCase": true,
  "includeFiles": ["./docs/*/*.md"],
  "excludeFiles": ["node_modules"],
  "linking": "absolute"
}

Output:

+ npx glossarify-md --config ./glossarify-md.conf.json --baseUrl https://github.com/my-org/my-repo/blob/branch_name --force
npx: installed 129 in 5.808s
┌──────────────────────────┐
│   glossarify-md v4.0.0   │
└──────────────────────────┘

☛ Reading from: /github/workspace
☛ Writing to:   /github/workspace

⚠ Warning: --baseDir and --outDir resolve to the same directory.
Such a config is going to overwrite input files in --baseDir.
Choose a different --outDir or change config provided via --config.
Use --force if you want to proceed with current settings.
See --help for details.

ABORTED.
@about-code about-code added the bug Something isn't working label Oct 18, 2020
@about-code
Copy link
Owner

Thank you very much for reporting. Would you mind verifing with npm install glossarify-md@next that the fix works for you?

Please note that the CLI has changed in version 4.0.0 and --baseUrl won't work anymore. There are now only two options --shallow or --deep to merge a JSON serialized configuration into the one provided by your glossarify-md.conf.json file so in your case I recommend

npx glossarify-md --config ./glossarify-md.conf.json --shallow "{'baseUrl': 'https://github.com/my-org/my-repo/blob/branch_name'}" --force

This is less convenient to type but makes it easier to provide any options available via the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants