mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Use PowerShell to set PATH instead of setx on Windows (#13254)
* fix(installer): use powershell to set PATH instead of setx * style: run prettier * style(installer): fix comma
This commit is contained in:
@@ -302,7 +302,9 @@ async function setup() {
|
||||
async function setupExecPath() {
|
||||
if (isWindows()) {
|
||||
// set for the current session and beyond
|
||||
child_process.execSync(`setx path "${meteorPath}/;%path%`);
|
||||
child_process.execSync(
|
||||
`powershell -c "$path = (Get-Item 'HKCU:\\Environment').GetValue('Path', '', 'DoNotExpandEnvironmentNames'); [Environment]::SetEnvironmentVariable('PATH', \\"${meteorPath};$path\\", 'User');"`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
const exportCommand = `export PATH=${meteorPath}:$PATH`;
|
||||
|
||||
Reference in New Issue
Block a user