feat(cli): install dependencies before build
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import decamelize from 'decamelize';
|
||||
import { join } from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
import {
|
||||
lstatSync,
|
||||
existsSync,
|
||||
@@ -128,4 +129,19 @@ export function smartOutputFile(filePath: string, content: string) {
|
||||
outputFileSync(filePath, content);
|
||||
}
|
||||
|
||||
let hasYarnCache: boolean;
|
||||
|
||||
export function hasYarn() {
|
||||
if (hasYarnCache === undefined) {
|
||||
try {
|
||||
execSync('yarn --version', { stdio: 'ignore' });
|
||||
hasYarnCache = true;
|
||||
} catch (e) {
|
||||
hasYarnCache = false;
|
||||
}
|
||||
}
|
||||
|
||||
return hasYarnCache;
|
||||
}
|
||||
|
||||
export { decamelize, getVantConfig };
|
||||
|
||||
Reference in New Issue
Block a user