Add USE_SNAP flag

This commit is contained in:
Michael Vines
2018-06-26 16:05:02 -07:00
committed by Grimes
parent 56b09bf0ac
commit 86f9277e2d

View File

@ -3,17 +3,25 @@
# Disable complaints about unused variables in this file: # Disable complaints about unused variables in this file:
# shellcheck disable=2034 # shellcheck disable=2034
if [[ -d "$SNAP" ]]; then # Running as a Linux Snap? if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap?
solana_program() { solana_program() {
local program="$1" local program="$1"
printf "%s/command-%s.wrapper" "$SNAP" "$program" printf "%s/command-%s.wrapper" "$SNAP" "$program"
} }
SOLANA_CUDA="$(snapctl get enable-cuda)" SOLANA_CUDA="$(snapctl get enable-cuda)"
elif [[ -n "$USE_SNAP" ]]; then # Use the Linux Snap binaries
solana_program() {
local program="$1"
printf "solana.%s" "$program"
}
elif [[ -n "$USE_INSTALL" ]]; then # Assume |cargo install| was run elif [[ -n "$USE_INSTALL" ]]; then # Assume |cargo install| was run
solana_program() { solana_program() {
local program="$1" local program="$1"
printf "solana-%s" "$program" printf "solana-%s" "$program"
} }
# CUDA was/wasn't selected at build time, can't affect CUDA state here
unset SOLANA_CUDA
else else
solana_program() { solana_program() {
local program="$1" local program="$1"