Skip to content

Commit e765be8

Browse files
committed
fix: Parse args correctly
1 parent 83966de commit e765be8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#!/usr/bin/env node
22
const fs = require("fs");
33
const less = require("less");
4-
const watch = require('node-watch');
4+
const watch = require("node-watch");
55
const argv = require("minimist")(
66
process.argv.slice(2),
7-
{alias: {"verbose": ["v"], "watch": ['w']}}
7+
{
8+
string: ['antd', 'theme'],
9+
boolean: ["verbose", "watch"],
10+
alias: {"verbose": ["v"], "watch": ["w"]},
11+
}
812
);
913

1014
const DEFAULTS = {
@@ -28,8 +32,8 @@ verbose && console.debug(`Verbose::
2832
Args:
2933
verbose: ${argv["verbose"] || ''}
3034
watch: ${argv["watch"] || ''}
31-
antd: ${argv['antd'] || ''}
32-
theme: ${argv['theme'] || ''}
35+
antd: ${argv["antd"] || ''}
36+
theme: ${argv["theme"] || ''}
3337
in: ${argv._[0] || ''}
3438
out: ${argv._[1] || ''}
3539
CWD: ${process.cwd()}
@@ -48,7 +52,7 @@ const imports = [
4852
].join('');
4953

5054
const compile = () => {
51-
console.log('Generating theme...');
55+
console.log("Generating theme...");
5256
less.render(imports, {javascriptEnabled: true})
5357
.then(
5458
({css}) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@emeks/antd-custom-theme-generator",
3-
"version": "0.1.7",
3+
"version": "0.2.0",
44
"peerDependencies": {
55
"antd": "^4.3.5"
66
},

0 commit comments

Comments
 (0)