Skip to content

Commit b237607

Browse files
committedMay 5, 2019
Updated 'args' passed to tasks
1 parent d37a741 commit b237607

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎package.json

+2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
"commander": "^2.20.0",
2525
"consola": "^2.6.0",
2626
"fs-extra": "^7.0.1",
27+
"getopts": "^2.2.4",
2728
"globby": "^9.2.0",
2829
"inquirer": "^6.3.1",
30+
"temp": "^0.9.0",
2931
"webpack": "^4.30.0",
3032
"which": "^1.3.1"
3133
},

‎src/cli.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const fs = require('fs-extra');
3232
const path = require('path');
3333
const consola = require('consola');
3434
const commander = require('commander');
35+
const getopts = require('getopts');
3536
const {createOptions, resolveOptions, loadTasks} = require('./utils.js');
3637
const {version} = require('../package.json');
3738

@@ -101,9 +102,10 @@ const cli = async (argv = [], opts = {}) => {
101102

102103
current
103104
.description(task.description)
104-
.action((args) => {
105+
.action(() => {
105106
const logger = consola.withTag(name);
106107
const started = new Date();
108+
const args = getopts(process.argv.slice(2));
107109

108110
task.action({logger, options, args, commander, argv})
109111
.then(() => {

0 commit comments

Comments
 (0)
Please sign in to comment.