Skip to content

Commit

Permalink
fix(create): update args and help to match
Browse files Browse the repository at this point in the history
  • Loading branch information
jakehamilton committed Dec 28, 2020
1 parent 2dbede1 commit 67abfa3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
21 changes: 18 additions & 3 deletions packages/titan/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/titan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
"url": "https://github.com/jakehamilton/packages/issues"
},
"devDependencies": {
"@types/node": "^14.11.1"
"@types/node": "^14.11.1",
"enquirer": "^2.3.6"
},
"dependencies": {
"@littlethings/log": "^2.3.0",
"@littlethings/test": "^1.2.1",
"@starters/core": "^1.1.0",
"@starters/core": "^1.2.0",
"arg": "^4.1.3",
"chalk": "^4.1.0",
"inquirer": "^7.3.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/titan/src/commands/create/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const getArgs = () => ({

"--template": String,
"-t": "--template",

"--name": String,
"-n": "--name",
},
{
permissive: false,
Expand Down
1 change: 0 additions & 1 deletion packages/titan/src/commands/create/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const help = () => {
--help Show this help message
--force, -f Overwrite existing directory if it exists
--private, -p Set the package to private
--name, -n Set the name used in package.json
--template, -t The {white.bold starters} template to use
Expand Down
6 changes: 5 additions & 1 deletion packages/titan/src/commands/create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ const command = () => {
const template = args["--template"] || "@starters/library";

try {
starters.create(target, template, name);
starters.create(
target,
template,
args["--name"] || path.basename(name)
);
} catch (error) {
log.error("Could not create package.");
process.exit(1);
Expand Down

0 comments on commit 67abfa3

Please # to comment.