UNPKG

@backstage/cli

Version:

CLI for developing Backstage plugins and apps

45 lines (39 loc) 1.5 kB
'use strict'; var ora = require('ora'); var chalk = require('chalk'); var run = require('../../../lib/run.cjs.js'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var ora__default = /*#__PURE__*/_interopDefaultCompat(ora); var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk); async function runYarnInstall() { const spinner = ora__default.default({ prefixText: `Running ${chalk__default.default.blue("yarn install")} to install new versions`, spinner: "arc", color: "green" }).start(); const installOutput = new Array(); try { await run.run("yarn", ["install"], { env: { FORCE_COLOR: "true", // We filter out all of the npm_* environment variables that are added when // executing through yarn. This works around an issue where these variables // incorrectly override local yarn or npm config in the project directory. ...Object.fromEntries( Object.entries(process.env).map( ([name, value]) => name.startsWith("npm_") ? [name, void 0] : [name, value] ) ) }, stdoutLogFunc: (data) => installOutput.push(data), stderrLogFunc: (data) => installOutput.push(data) }); spinner.succeed(); } catch (error) { spinner.fail(); process.stdout.write(Buffer.concat(installOutput)); throw error; } } exports.runYarnInstall = runYarnInstall; //# sourceMappingURL=utils.cjs.js.map