You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While generating docs in a directory that is git tracked, the program throws an error.
How to Reproduce
# Install ag
sudo npm install -g @asyncapi/generator
# Create a test directory and track its content with git
mkdir testcd test/
git init
# Generate docs
ag https://bit.ly/asyncapi @asyncapi/html-template -o example
Something went wrong:
Error: "/home/lukasz/test/example" is in a git repository with unstaged changes. Please commit your changes before proceeding or add proper directory to .gitignore file. You can also use the --force-write flag to skip this rule (not recommended).
at Generator.verifyTargetDir (/usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:1010:71)
at async Generator.setupFSOutput (/usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:232:7)
Expected behavior
The program should not throw an error and should generate HTML documentation.
The text was updated successfully, but these errors were encountered:
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
I fixed this issue with the --force-write flag. I wish it were set to true by default :)
ag @asyncapi/html-template --help
Usage: ag [options] <asyncapi><template>
Options:
-V, --version output the version number
-d, --disable-hook [hooks...] disable a specific hook type or hooks from given hook type
--debug enable more specific errors in the console
-i, --install installs the template and its dependencies (defaults to false)
-n, --no-overwrite <glob> glob or path of the file(s) to skip when regenerating
-o, --output <outputDir> directory where to put the generated files (defaults to current directory) (default: "/home/lukasz/test")
-p, --param <name=value> additional param to pass to templates
--force-write force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)
--watch-template watches the template directory and the AsyncAPI document, and re-generate the files when changes occur. Ignores the output directory. This flag should be
used only for template development.
--map-base-url <url:folder> maps all schema references from base url to local folder
-h, --help display helpforcommand
Describe the bug
While generating docs in a directory that is git tracked, the program throws an error.
How to Reproduce
Expected behavior
The program should not throw an error and should generate HTML documentation.
The text was updated successfully, but these errors were encountered: