mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 22:09:25 +00:00
feat(helper): add os-type helper functions
Add the following functions: - is-darwin - is-linux - is-bsd - is-cygwin And apply them everywhere I found code doing that what these functions do.
This commit is contained in:
committed by
Kaleb Elwert
parent
1b99be879c
commit
f4ca9ebfc9
@ -29,3 +29,23 @@ function coalesce {
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# is true on MacOS Darwin
|
||||
function is-darwin {
|
||||
[[ "$OSTYPE" == darwin* ]]
|
||||
}
|
||||
|
||||
# is true on Linux's
|
||||
function is-linux {
|
||||
[[ "$OSTYPE" == linux* ]]
|
||||
}
|
||||
|
||||
# is true on BSD's
|
||||
function is-bsd {
|
||||
[[ "$OSTYPE" == *bsd* ]]
|
||||
}
|
||||
|
||||
# is true on Cygwin (Windows)
|
||||
function is-cygwin {
|
||||
[[ "$OSTYPE" == cygwin* ]]
|
||||
}
|
||||
|
Reference in New Issue
Block a user