diff --git a/Makefile b/Makefile index fac7757b93..0ee33c0026 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ export TARGET ?= $(TARGET_OS) endif # Useful for checking if we are on NixOS -OS_NAME := $(shell awk -F= '/^NAME/{print $2}' /etc/os-release) +OS_NAME := $(shell [ -f /etc/os-release ] && awk -F= '/^NAME/{print $2}' /etc/os-release) # Useful for Andoird release builds TMP_BUILD_NUMBER := $(shell ./scripts/version/gen_build_no.sh | cut -c1-10) diff --git a/scripts/generate-keystore.sh b/scripts/generate-keystore.sh index 1015db20f3..c017ed9c0d 100755 --- a/scripts/generate-keystore.sh +++ b/scripts/generate-keystore.sh @@ -31,7 +31,7 @@ KEYSTORE_PATH=$(env_var_or_gradle_prop 'KEYSTORE_PATH') KEYSTORE_PATH=${KEYSTORE_PATH/#\~/$HOME} if [[ -e "${KEYSTORE_PATH}" ]]; then - echo -e "${YLW}Keystore file already exists:${RST} ${KEYSTORE_PATH}" > /dev/stderr + echo -e "${YLW}Keystore file already exists:${RST} ${KEYSTORE_PATH}" >&2 echo "${KEYSTORE_PATH}" exit 0 fi @@ -39,7 +39,7 @@ fi KEYSTORE_DIR=$(dirname "${KEYSTORE_PATH}") [[ -d $KEYSTORE_DIR ]] || mkdir -p $KEYSTORE_DIR -echo -e "${GRN}Generating keystore...${RST}" > /dev/stderr +echo -e "${GRN}Generating keystore...${RST}" >&2 keytool -genkey -v \ -keyalg RSA \ diff --git a/scripts/release-android.sh b/scripts/release-android.sh index ad0383eba3..d6cb04c1dd 100755 --- a/scripts/release-android.sh +++ b/scripts/release-android.sh @@ -46,14 +46,14 @@ nixOpts+=( "--argstr" "secrets-file" "${SECRETS_FILE_PATH}" ) -if [[ "$OS" =~ Darwin ]]; then +if [[ "$(uname -s)" =~ Darwin ]]; then # Start a watchman instance if not started already and store its socket path. # In order to get access to the right versions of watchman and jq, # we start an ad-hoc nix-shell that imports the packages from nix/nixpkgs-bootstrap. WATCHMAN_SOCKFILE=$(watchman get-sockname --no-pretty | jq -r .sockname) nixOpts+=( - " --argstr" "watchmanSockPath" "${WATCHMAN_SOCKFILE}" - " --option" "extra-sandbox-paths" "${KEYSTORE_PATH} ${SECRETS_FILE_PATH} ${WATCHMAN_SOCKFILE}" + "--argstr" "watchmanSockPath" "${WATCHMAN_SOCKFILE}" + "--option" "extra-sandbox-paths" "${KEYSTORE_PATH} ${SECRETS_FILE_PATH} ${WATCHMAN_SOCKFILE}" ) else nixOpts+=(