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
1 changed files with 9 additions and 1 deletions

View File

@ -3,17 +3,25 @@
# Disable complaints about unused variables in this file:
# shellcheck disable=2034
if [[ -d "$SNAP" ]]; then # Running as a Linux Snap?
if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap?
solana_program() {
local program="$1"
printf "%s/command-%s.wrapper" "$SNAP" "$program"
}
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
solana_program() {
local program="$1"
printf "solana-%s" "$program"
}
# CUDA was/wasn't selected at build time, can't affect CUDA state here
unset SOLANA_CUDA
else
solana_program() {
local program="$1"