Comparing version 0.0.2 to 0.1.0
@@ -26,2 +26,3 @@ #!/usr/bin/env node | ||
}) | ||
.command('*') | ||
.demandCommand(1, 'You must specify a command for Haste to run.\nUSAGE: haste <command>') | ||
@@ -35,4 +36,12 @@ .version() | ||
explorer.load(context) | ||
.then(({ config }) => { | ||
const presetPath = resolveFrom(context, config.preset); | ||
.then((result) => { | ||
if (!result) { | ||
throw new Error('Can\'t find .hasterc or a "haste" field under package.json'); | ||
} | ||
if (!result.config.preset) { | ||
throw new Error('"preset" is a mandatory field'); | ||
} | ||
const presetPath = resolveFrom(context, result.config.preset); | ||
const run = haste(presetPath); | ||
@@ -42,3 +51,7 @@ const preset = require(presetPath); | ||
return run(command, [argv, config]) | ||
if (!command) { | ||
throw new Error(`${result.config.preset} doesn't support command ${cmd}`); | ||
} | ||
return run(command, [argv, result.config]) | ||
.then(({ persistent }) => { | ||
@@ -49,6 +62,3 @@ if (!persistent) { | ||
}) | ||
.catch((error) => { | ||
console.log(error.stack || error); | ||
process.exit(1); | ||
}); | ||
.catch(() => process.exit(1)); | ||
}); |
{ | ||
"name": "haste-cli", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"main": "index.js", | ||
@@ -12,6 +12,9 @@ "author": "Ronen Amiel", | ||
"cosmiconfig": "^2.2.2", | ||
"haste-core": "^0.0.2", | ||
"haste-core": "^0.1.0", | ||
"resolve-from": "~3.0.0", | ||
"yargs": "^8.0.2" | ||
}, | ||
"devDependencies": { | ||
"execa": "^0.8.0" | ||
} | ||
} |
4208
7
108
1
+ Addedhaste-core@0.1.22(transitive)
+ Addeduuid@3.4.0(transitive)
- Removedhaste-core@0.0.2(transitive)
- Removedrxjs@5.5.12(transitive)
- Removedsymbol-observable@1.0.1(transitive)
Updatedhaste-core@^0.1.0