Skip to content

Commit f8e1ead

Browse files
committed
fix(build): don't check yo version on CI
1 parent 58c9dbf commit f8e1ead

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: src/generators/generator-base.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ lodash.mixin(s.exports());
1414
export function genBase(self) {
1515
self = self || this;
1616

17-
let yoCheckPromise = genUtils.runCmd('yo --version').then(stdout => {
18-
if(!semver.satisfies(semver.clean(stdout), '>= 1.7.1')) {
19-
throw new Error('ERROR: You need to update yo to at least 1.7.1 (npm i -g yo)');
20-
}
21-
});
17+
let yoCheckPromise;
18+
if(!process.env.CI) {
19+
yoCheckPromise = genUtils.runCmd('yo --version').then(stdout => {
20+
if(!semver.satisfies(semver.clean(stdout), '>= 1.7.1')) {
21+
throw new Error('ERROR: You need to update yo to at least 1.7.1 (npm i -g yo)');
22+
}
23+
});
24+
} else {
25+
// CI won't have yo installed
26+
yoCheckPromise = Promise.resolve();
27+
}
2228

2329
self.lodash = lodash;
2430
self.yoWelcome = yoWelcome;

0 commit comments

Comments
 (0)