Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ PRIV_KEY_PATH=/root/.ssh/id_rsa
# Path to the linux kernel directory, as bind-mounted in the container.
CTR_KERNEL_DIR="${CTR_FC_ROOT_DIR}/.kernel"

# Global options received by $0
# These options are not command-specific, so we store them as global vars
OPT_UNATTENDED=false

# Get the target prefix to avoid repeated calls to uname -m
TARGET_PREFIX="$(uname -m)-unknown-linux-"

Expand Down Expand Up @@ -195,7 +191,6 @@ ensure_devctr() {
# download it, if we don't.
[[ $(docker images -q "$DEVCTR_IMAGE" | wc -l) -gt 0 ]] || {
say "About to pull docker image $DEVCTR_IMAGE"
get_user_confirmation || die "Aborted."

# Run docker pull 5 times in case it fails - sleep 3 seconds
# between attempts
Expand Down Expand Up @@ -1235,7 +1230,8 @@ main() {
while [ $# -gt 0 ]; do
case "$1" in
-h|--help) { cmd_help; exit 1; } ;;
-y|--unattended) { OPT_UNATTENDED=true; } ;;
-y|--unattended) # purposefully ignored
;;
-*)
die "Unknown arg: $1. Please use \`$0 help\` for help."
;;
Expand Down
5 changes: 0 additions & 5 deletions tools/functions
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ function SGR {
# exit code 0 for successful confirmation
# exit code != 0 if the user declined
#
OPT_UNATTENDED=false
get_user_confirmation() {

# Pass if running unattended
[[ "$OPT_UNATTENDED" = true ]] && return 0

# Fail if STDIN is not a terminal (there's no user to confirm anything)
[[ -t 0 ]] || return 1

Expand Down
Loading