Skip to content
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

Set environment for powershell on all platforms #1017

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

KiruyaMomochi
Copy link
Contributor

Before this PR

Running . ./emsdk_env.ps1 on Linux PowerShell (pwsh) only output Setting environment variables, but none
of these variables are set actually
.

PS /home/kyaru/projects/emsdk> . ./emsdk_env.ps1
Adding directories to PATH: ...
Setting environment variables: ...

PS /home/kyaru/projects/emsdk> emsdk
emsdk: The term 'emsdk' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Solution

Decide whether to call write_set_env_script or not by checking current shell, not platform.

After this PR

The script works on all platforms.

PS /home/kyaru/projects/emsdk> . ./emsdk_env.ps1
Adding directories to PATH: ...
Setting environment variables: ...

PS /home/kyaru/projects/emsdk> emsdk
Missing command; Type 'emsdk help' to get a list of commands.

@sbc100
Copy link
Collaborator

sbc100 commented Mar 28, 2022

TIL, you can run powershell outside of windows. Out of interested, on what platform are you running it?

@KiruyaMomochi
Copy link
Contributor Author

KiruyaMomochi commented Mar 28, 2022

I'm using it on all platforms (Windows, Linux and macOS).

See this GitHub Action file: https://github.com/KiruyaMomochi/AssetStudio/blob/cross/.github/workflows/texture-decoder.yml

@sbc100 sbc100 merged commit 714d434 into emscripten-core:main Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants