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

--from flag is ignored when no template is present #55

Open
BearAlliance opened this issue Nov 24, 2021 · 1 comment
Open

--from flag is ignored when no template is present #55

BearAlliance opened this issue Nov 24, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@BearAlliance
Copy link
Contributor

Bug Report

Description

When templates do not exist, the --from flag is ignored, and an error is thrown.

Steps to Reproduce

See the sample repository

  1. Delete the template from a boilerplate project
  2. Attempt to generate a new ADR with the --from flag

Expected Behavior

A new ADR is generated from the file specified by --from

Context

Didn't have a need for the base template. Only two packages are used, each with their own template.
Before I figured out that putting template.md in the adrFolder directory worked, I tried using the --from CLI argument.

Environment

  • Log4brains version: ^1.0.0-beta.11
  • Node.js version: v16.13.0
  • OS and its version: MacOS 12.0.1 (Apple M1)
  • Browser information: N/A

Possible Solution

The error is thrown from AdrTemplateRepository.ts. It would seem that this template check is done before checking the path provided with --from.

You can just define a template in any of the adrFolder directories to get around this, and the --from flag works just fine, but it would seem to me that that argument, and the presence of a template, are independent of one another.

@BearAlliance BearAlliance added the bug Something isn't working label Nov 24, 2021
@BearAlliance
Copy link
Contributor Author

Ah, just found this

// --from option (used by init-log4brains to create the starter ADRs)
// Since this is a private use case, we don't include it in CORE for now

Is the --from flag not meant to be used by the end user? That intention makes sense given the current behavior.
I found it using --help, not in the README.

npx log4brains adr new --help

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

No branches or pull requests

1 participant