diff --git a/common/scripts/install-run-rush.js b/common/scripts/install-run-rush.js index 7fc381d5640a..4cc67a75b166 100644 --- a/common/scripts/install-run-rush.js +++ b/common/scripts/install-run-rush.js @@ -34,12 +34,12 @@ function _getRushVersion() { } catch (e) { throw new Error(`Unable to determine the required version of Rush from rush.json (${rushJsonFolder}). ` + - 'The \'rushVersion\' field is either not assigned in rush.json or was specified ' + + "The 'rushVersion' field is either not assigned in rush.json or was specified " + 'using an unexpected syntax.'); } } function _run() { - const [nodePath, /* Ex: /bin/node */ scriptPath, /* /repo/common/scripts/install-run-rush.js */ ...packageBinArgs /* [build, --to, myproject] */] = process.argv; + const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, ...packageBinArgs /* [build, --to, myproject] */] = process.argv; // Detect if this script was directly invoked, or if the install-run-rushx script was invokved to select the // appropriate binary inside the rush package to run const scriptName = path.basename(scriptPath); diff --git a/common/scripts/install-run.js b/common/scripts/install-run.js index 94eca0259c3c..53e27aa69ba1 100644 --- a/common/scripts/install-run.js +++ b/common/scripts/install-run.js @@ -303,14 +303,14 @@ function _cleanInstallFolder(rushTempFolder, packageInstallFolder) { function _createPackageJson(packageInstallFolder, name, version) { try { const packageJsonContents = { - 'name': 'ci-rush', - 'version': '0.0.0', - 'dependencies': { + name: 'ci-rush', + version: '0.0.0', + dependencies: { [name]: version }, - 'description': 'DON\'T WARN', - 'repository': 'DON\'T WARN', - 'license': 'MIT' + description: "DON'T WARN", + repository: "DON'T WARN", + license: 'MIT' }; const packageJsonPath = path.join(packageInstallFolder, PACKAGE_JSON_FILENAME); fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonContents, undefined, 2)); @@ -345,7 +345,7 @@ function _installPackage(packageInstallFolder, name, version) { */ function _getBinPath(packageInstallFolder, binName) { const binFolderPath = path.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME, '.bin'); - const resolvedBinName = (os.platform() === 'win32') ? `${binName}.cmd` : binName; + const resolvedBinName = os.platform() === 'win32' ? `${binName}.cmd` : binName; return path.resolve(binFolderPath, resolvedBinName); } /** @@ -378,10 +378,11 @@ function installAndRun(packageName, packageVersion, packageBinName, packageBinAr const statusMessageLine = new Array(statusMessage.length + 1).join('-'); console.log(os.EOL + statusMessage + os.EOL + statusMessageLine + os.EOL); const binPath = _getBinPath(packageInstallFolder, packageBinName); + const binFolderPath = path.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME, '.bin'); const result = childProcess.spawnSync(binPath, packageBinArgs, { stdio: 'inherit', cwd: process.cwd(), - env: process.env + env: Object.assign({}, process.env, { PATH: [binFolderPath, process.env.PATH].join(path.delimiter) }) }); if (result.status !== null) { return result.status; @@ -403,7 +404,7 @@ function runWithErrorAndStatusCode(fn) { } exports.runWithErrorAndStatusCode = runWithErrorAndStatusCode; function _run() { - const [nodePath, /* Ex: /bin/node */ scriptPath, /* /repo/common/scripts/install-run-rush.js */ rawPackageSpecifier, /* qrcode@^1.2.0 */ packageBinName, /* qrcode */ ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; + const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, rawPackageSpecifier /* qrcode@^1.2.0 */, packageBinName /* qrcode */, ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; if (!nodePath) { throw new Error('Unexpected exception: could not detect node path'); } diff --git a/rush.json b/rush.json index 9b8e2c4b2d7d..0f1069646931 100644 --- a/rush.json +++ b/rush.json @@ -15,7 +15,7 @@ * path segment in the "$schema" field for all your Rush config files. This will ensure * correct error-underlining and tab-completion for editors such as VS Code. */ - "rushVersion": "5.24.0", + "rushVersion": "5.26.0", /** * The next field selects which package manager should be installed and determines its version. * Rush installs its own local copy of the package manager to ensure that your build process