make in to sibling project
This commit is contained in:
+17
-5
@@ -3,7 +3,8 @@ set -e
|
||||
#
|
||||
# Purpose : Compile and install applications from compile.conf
|
||||
|
||||
CONF_FILE="$HOME/.local/share/HamPackServer/compile.conf"
|
||||
HAMPACKSERVER_DIR="${HAMPACKSERVER_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
|
||||
CONF_FILE="$HAMPACKSERVER_DIR/compile.conf"
|
||||
TMP_DIR="$HOME/.cache/hampack-build"
|
||||
VERSION_FILE="$HOME/.local/state/HamPackServer/.installed_versions"
|
||||
|
||||
@@ -63,6 +64,19 @@ save_installed_version() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Ask the user a yes/no question. Only install.sh asks; during `update` the
|
||||
# answer is no, so `update` runs through without prompting
|
||||
ask_yes_no() {
|
||||
local question="$1"
|
||||
|
||||
if [ -z "$HAMPACKSERVER_INTERACTIVE" ]; then
|
||||
echo "$question [y/N] no (run \`sibling add\` again to be asked)"
|
||||
return 1
|
||||
fi
|
||||
read -rp "$question [y/N] " response </dev/tty
|
||||
[[ "$response" =~ ^[yY] ]]
|
||||
}
|
||||
|
||||
# Ask the user whether to proceed when version can't be determined
|
||||
ask_user_proceed() {
|
||||
local app="$1"
|
||||
@@ -70,8 +84,7 @@ ask_user_proceed() {
|
||||
|
||||
echo "Warning: could not determine installed version of $app."
|
||||
echo "compile.conf specifies version $latest."
|
||||
read -rp "Compile and install $app anyway? [y/N] " response </dev/tty
|
||||
[[ "$response" =~ ^[yY] ]]
|
||||
ask_yes_no "Compile and install $app anyway?"
|
||||
}
|
||||
|
||||
# Check if an update is needed
|
||||
@@ -252,8 +265,7 @@ process_app() {
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo " Warning: no version specified in compile.conf for $app."
|
||||
read -rp " Compile and install $app anyway? [y/N] " response </dev/tty
|
||||
if [[ ! "$response" =~ ^[yY] ]]; then
|
||||
if ! ask_yes_no " Compile and install $app anyway?"; then
|
||||
echo " Skipping $app."
|
||||
return
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user