Files
status-react/scripts/setup
T

52 lines
1.6 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
########################################################################
2017-12-01 09:17:25 -08:00
# This install script will setup your development dependencies on OS X
# or Ubuntu. Ubuntu 18.04 is the only tested version.
# It is not required or supported in NixOS.
#
2017-12-01 09:17:25 -08:00
# Usage: scripts/setup
########################################################################
2019-11-29 11:20:08 +01:00
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
source "$GIT_ROOT/scripts/lib/setup/path-support.sh"
source_lib "output.sh"
source_lib "packages.sh"
source_lib "platform.sh"
2017-12-01 09:17:25 -08:00
exit_unless_os_supported
####
setup_header "Checking prerequisites..."
2019-05-06 15:16:31 +02:00
_need_curl=0
! is_nixos && ! program_exists nix && _need_curl=1
if [ $_need_curl -eq 1 ] && ! program_exists "curl"; then
cecho "@b@yellow[[Please install curl before running setup.]]"
exit 1
fi
2019-11-29 11:20:08 +01:00
# bump max watches limit to avoid issues with RN builds
$GIT_ROOT/scripts/inotify_fix.sh
####
setup_header "Installing requirements..."
2019-05-06 15:16:31 +02:00
if [ "$IN_NIX_SHELL" != 'pure' ] && ! is_nixos && ! program_exists nix; then
2019-11-21 18:41:34 +01:00
required_version="2.3.1"
2019-11-29 11:20:08 +01:00
NIX_INSTALLER_NO_MODIFY_PROFILE=1 NIX_IGNORE_SYMLINK_STORE=1 bash <(curl https://nixos.org/releases/nix/nix-${required_version}/install) --no-daemon
if [ $? -eq 0 ]; then
echo -e "${YELLOW}**********************************************************************************************************"
echo "The Nix package manager was successfully installed."
echo -e "**********************************************************************************************************${NC}"
else
echo "Please see https://nixos.org/nix/manual/#chap-installation"
exit
fi
fi
####
setup_complete