2017-12-01 17:17:25 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
OS=$(uname -s)
|
|
|
|
|
|
|
|
function is_macos() {
|
|
|
|
[[ "$OS" =~ Darwin ]]
|
|
|
|
}
|
|
|
|
|
|
|
|
function is_linux() {
|
|
|
|
[[ "$OS" =~ Linux ]]
|
|
|
|
}
|
|
|
|
|
2019-02-01 10:44:51 +00:00
|
|
|
function is_nixos() {
|
|
|
|
is_linux && [[ "$(uname -v)" == *NixOS* ]]
|
|
|
|
}
|
|
|
|
|
2017-12-01 17:17:25 +00:00
|
|
|
function exit_unless_os_supported() {
|
2019-05-07 15:57:30 +00:00
|
|
|
if [ "$IN_NIX_SHELL" == 'pure' ]; then
|
2019-05-10 13:20:40 +00:00
|
|
|
cecho "@red[[This install script is not supported in a pure Nix shell]]"
|
2019-05-07 15:57:30 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-12-21 09:28:55 +00:00
|
|
|
if ! is_macos && ! is_linux; then
|
|
|
|
cecho "@red[[This install script currently supports Mac OS X and Linux \
|
2018-11-15 14:32:18 +00:00
|
|
|
via apt. To manually install, please visit the docs for more information:]]
|
2017-12-01 17:17:25 +00:00
|
|
|
|
2018-11-15 14:32:18 +00:00
|
|
|
@blue[[https://status.im/build_status]]"
|
2017-12-01 17:17:25 +00:00
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|