-
Notifications
You must be signed in to change notification settings - Fork 278
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
Command Line Parameters causing bad option: --plopfile=plopfile.ts #456
Comments
This bug doesn't seem limited to TypeScript because I tried a basic JavaScript version too... Create a export default function (plop) {
plop.setGenerator("sample", {
description: "Sample Generator to show bug with command line arguments.",
prompts: [
{
type: "input",
name: "name",
message: "Project Name:",
},
{
type: "input",
name: "title",
message: "Project Title:",
},
],
actions: ["No operation necessary"],
});
} Next, tweak the "scripts": {
"plop": "plop",
}, Then, try specifying both parameters:
This is different than if you don't specify
|
I traced this problem to the internals of Liftoff, which uses flagged-respawn. I noticed that the
It appears that the As a result, I need to change my prompt name to be something else like Now that I understand what is going on, I will work around this, but this strikes me as unexpected behavior. I wouldn't expect the parameters after |
Summary
I am trying to pass command-line options to my plop script, but it instead provides an error message:
I am using a TypeScript plopfile, inspired by #423 and documented here.
How to Reproduce
Create a
package.json
Create a
plopfile.ts
Install dependencies
Validate that Prompts Work Fine
Run the
plop
script and answer the prompts. It will look something like this:Use Command Line Parameters to Bypass Prompts 🐛
Run the
plop
script with answers to bypass the prompts. It will look something like this:Interesting Note 🤔
If you only supply
name
and nottitle
, then it works fine:Also, if you remove the
title
from theprompts
and simply have the onename
prompt left, then that will work fine too:Please help 🛟
The text was updated successfully, but these errors were encountered: