renamed npm list cmd string

This commit is contained in:
SrTobi 2016-02-29 11:32:04 +01:00
parent 44ecf31435
commit b5501e6127

View file

@ -1,11 +1,11 @@
import * as path from 'path'; import * as path from 'path';
import * as cp from 'child_process'; import * as cp from 'child_process';
const cmd = 'npm list --production --parseable'; const listCmd = 'npm list --production --parseable';
export function getDependencies(cwd: string): Promise<string[]> { export function getDependencies(cwd: string): Promise<string[]> {
return new Promise<string[]>((c, e) => { return new Promise<string[]>((c, e) => {
cp.exec(cmd, { cwd }, (err, stdout, stderr) => { cp.exec(listCmd, { cwd }, (err, stdout, stderr) => {
if (err) return e(err); if (err) return e(err);
c(stdout.toString('utf8') c(stdout.toString('utf8')