Skip to content

Commit

Permalink
feat(core): detect and use appropriate package manager to install deps
Browse files Browse the repository at this point in the history
  • Loading branch information
tinesoft committed Nov 8, 2019
1 parent 5880dc8 commit 10b5628
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class Helpers {
let options = {
cwd: projectPath
};
yield exec.exec('npm', ['ci'], options);
const useYarn = yield Helpers.isFileExists(path.join(projectPath, 'yarn.lock'));
yield (useYarn ? exec.exec('yarn', ['install'], options) : exec.exec('npm', ['ci'], options));
});
}
static getLocalNgExecPath(baseDir) {
Expand Down
4 changes: 3 additions & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export class Helpers {
let options: ExecOptions = {
cwd: projectPath
};
await exec.exec('npm',['ci'], options);

const useYarn = await Helpers.isFileExists(path.join(projectPath, 'yarn.lock'));
await (useYarn? exec.exec('yarn',['install'], options) : exec.exec('npm',['ci'], options));
}

public static getLocalNgExecPath(baseDir:string){
Expand Down

0 comments on commit 10b5628

Please sign in to comment.