-
Notifications
You must be signed in to change notification settings - Fork 807
Set user environment variables permanently by using --permanent + deprecate --global
#621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8505d6b
Set user environment variables by default in Windows
saschanaz 84e00aa
remove redundant parameter
saschanaz adb8541
set `arg_global`if `arg_system` is provided
aminya 86358df
add documentation for --global and --system options
aminya 9f24f8e
deprecate --global, introduce --permanent
aminya 188c5ac
add tests for --permanent on Windows
aminya 25efaf4
set arg_permanent if arg_global is used
aminya bd028b9
don't use arg_global anymore
aminya 8bd5422
add --permanent to readme
aminya 90c07a8
test: use repo root instead of cd
aminya 2d7ccb2
ci: allow failure of the permanent test in CI
aminya 4dae940
Fix typos
aminya f34f705
Mention admin access in the help for --system
aminya ad16e5d
set --system when --global used
aminya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| $repo_root = [System.IO.Path]::GetDirectoryName((resolve-path "$PSScriptRoot")) | ||
|
|
||
| & "$repo_root/emsdk.ps1" install latest | ||
| & "$repo_root/emsdk.ps1" activate latest --permanent | ||
|
|
||
| $EMSDK_USER = [System.Environment]::GetEnvironmentVariable("EMSDK", "User") | ||
| $EM_CONFIG_USER = [System.Environment]::GetEnvironmentVariable("EM_CONFIG", "User") | ||
| $EMSDK_NODE_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_NODE", "User") | ||
| $EMSDK_PYTHON_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_PYTHON", "User") | ||
| $JAVA_HOME_USER = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", "User") | ||
| $EM_CACHE_USER = [System.Environment]::GetEnvironmentVariable("EM_CACHE", "User") | ||
| $PATH_USER = [System.Environment]::GetEnvironmentVariable("PATH", "User") | ||
|
|
||
| if (!$EMSDK_USER) { | ||
| throw "EMSDK is not set for the user" | ||
| } | ||
| if (!$EM_CONFIG_USER) { | ||
| throw "EM_CONFIG_USER is not set for the user" | ||
| } | ||
| if (!$EMSDK_NODE_USER) { | ||
| throw "EMSDK_NODE is not set for the user" | ||
| } | ||
| if (!$JAVA_HOME_USER) { | ||
| throw "JAVA_HOME is not set for the user" | ||
| } | ||
| if (!$EMSDK_PYTHON_USER) { | ||
| throw "EMSDK_PYTHON is not set for the user" | ||
| } | ||
| if (!$EM_CACHE_USER) { | ||
| throw "EM_CACHE is not set for the user" | ||
| } | ||
|
|
||
|
|
||
| $path_split = $PATH_USER.Split(';') | ||
|
|
||
| $EMSDK_Path_USER = $path_split | Where-Object { $_ -match 'emsdk' } | ||
| if (!$EMSDK_Path_USER) { | ||
| throw "No path is added!" | ||
| } | ||
| $EMSDK_NODE_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\node' } | ||
| if (!$EMSDK_NODE_Path_USER) { | ||
| throw "emsdk\node is not added to path." | ||
| } | ||
| $EMSDK_PYTHON_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\python' } | ||
| if (!$EMSDK_PYTHON_Path_USER) { | ||
| throw "emsdk\python is not added to path." | ||
| } | ||
| $EMSDK_JAVA_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\java' } | ||
| if (!$EMSDK_JAVA_Path_USER) { | ||
| throw "emsdk\java is not added to path." | ||
| } | ||
|
|
||
| $EMSDK_UPSTREAM_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\upstream\\emscripten' } | ||
| if (!$EMSDK_UPSTREAM_Path_USER) { | ||
| throw "emsdk\upstream\emscripten is not added to path." | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.