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

Allow os-specific subsections #31

Open
JPHutchins opened this issue Jul 24, 2024 · 1 comment
Open

Allow os-specific subsections #31

JPHutchins opened this issue Jul 24, 2024 · 1 comment

Comments

@JPHutchins
Copy link
Owner

JPHutchins commented Jul 24, 2024

This is breaking change. And easy to screw up.

Notably because it's possible to run any of the bash, zsh, and PS on any of Mac, Windows, Linux. So the OS needs to be checked from both the sh and powershell sections rather than simply assuming powershell == Windows, bash == Linux and zsh == Mac.

[path]
TOOL1=$HOME/tool1
TOOL2=$HOME/tool2

[path.windows]
# TOOL1 will not be overwritten on windows systems but TOOL2 will be.
TOOL2=C:/tool2
@JPHutchins JPHutchins added this to the Breaking changes for 1.0.0 milestone Jul 24, 2024
@JPHutchins
Copy link
Owner Author

Looks straightforward in PowerShell (not sure about PowerShell 5 🙄), simple booleans are ready:

$IsWindows
True
$IsMacOS
False
$IsLinux
False

In bash, $OSTYPE can be used to similar effect:

echo $OSTYPE
linux-gnu

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

No branches or pull requests

1 participant