npmci/ts/npmci.command.ts

16 lines
471 B
TypeScript
Raw Permalink Normal View History

2016-11-25 13:25:45 +01:00
import * as plugins from './npmci.plugins'
import {bash} from './npmci.bash'
2016-06-11 20:22:00 +02:00
2016-06-11 20:30:35 +02:00
export let command = () => {
2016-06-11 20:22:00 +02:00
let done = plugins.q.defer()
2016-11-25 13:25:45 +01:00
let wrappedCommand: string = ''
let argvArray = process.argv
for (let i = 3; i < argvArray.length; i++) {
wrappedCommand = wrappedCommand + argvArray[i]
if (i + 1 !== argvArray.length) { wrappedCommand = wrappedCommand + ' ' }
2016-06-11 21:01:44 +02:00
}
2016-11-25 13:25:45 +01:00
bash(wrappedCommand)
done.resolve()
2016-06-11 20:22:00 +02:00
return done.promise
2016-11-25 13:25:45 +01:00
}