-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: feat(tracking): Check for Third party NPM replacemen…
…ts and make use of those if set by default
- Loading branch information
1 parent
137a0de
commit deab013
Showing
22 changed files
with
126 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as chalk from 'chalk'; | ||
import {exec} from 'child_process'; | ||
import {CliConfig} from '../models/config'; | ||
|
||
const Promise = require('../ember-cli/lib/ext/promise'); | ||
const execPromise = Promise.denodeify(exec); | ||
const packageManager = CliConfig.fromGlobal().get('packageManager'); | ||
|
||
|
||
export function checkYarnOrCNPM() { | ||
if (packageManager !== 'default') { | ||
return Promise.resolve(); | ||
} | ||
|
||
return Promise | ||
.all([checkYarn(), checkCNPM()]) | ||
.then((data: Array<boolean>) => { | ||
const [isYarnInstalled, isCNPMInstalled] = data; | ||
if (isYarnInstalled && isCNPMInstalled) { | ||
console.log(chalk.yellow('You can `ng set --global packageManager=yarn` ' | ||
+ 'or `ng set --global packageManager=cnpm`.')); | ||
} else if (isYarnInstalled) { | ||
console.log(chalk.yellow('You can `ng set --global packageManager=yarn`.')); | ||
} else if (isCNPMInstalled) { | ||
console.log(chalk.yellow('You can `ng set --global packageManager=cnpm`.')); | ||
} | ||
}); | ||
} | ||
|
||
function checkYarn() { | ||
return execPromise('yarn --version') | ||
.then(() => true, () => false); | ||
} | ||
|
||
function checkCNPM() { | ||
return execPromise('cnpm --version') | ||
.then(() => true, () => false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.