Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public ensureRushVersionInstalled(
version: string,
configuration: MinimalRushConfiguration | undefined
): Promise {
const isLegacyRushVersion: boolean = semver.lt(version, '4.0.0');
const expectedRushPath: string = path.join(this._rushGlobalFolder.nodeSpecificPath, `rush-${version}`);
const installMarker: _LastInstallFlag = new _LastInstallFlag(expectedRushPath, {
node: process.versions.node
});
let installPromise: Promise = Promise.resolve();
if (!installMarker.isValid()) {
installPromise = installPromise.then(() => {
// Need to install Rush
console.log(`Rush version ${version} is not currently installed. Installing...`);
const resourceName: string = `rush-${version}`;
console.log(`Trying to acquire lock for ${resourceName}`);
return LockFile.acquire(expectedRushPath, resourceName).then((lock: LockFile) => {
if (installMarker.isValid()) {