xrestricted: add --yes flag for non-interactive use
This commit is contained in:
		
							parent
							
								
									81d73d6363
								
							
						
					
					
						commit
						6345cbdb09
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -20,7 +20,9 @@ if [[ ! -d $PACKAGES_DIR ]]; then | |||
| 	exit 1 | ||||
| fi | ||||
| 
 | ||||
| zparseopts -D -E h=help -help=help j:=jobs -jobs:=jobs b:=branch -branch:=branch | ||||
| zparseopts -D -E h=help -help=help j:=jobs -jobs:=jobs b:=branch -branch:=branch y=yes -yes=yes | ||||
| 
 | ||||
| if [[ $yes ]]; then echo "auto mode: $yes"; fi | ||||
| 
 | ||||
| if [[ $help ]]; then | ||||
| 	<<-HELP | ||||
|  | @ -70,7 +72,7 @@ install_restricted() { | |||
| 	else | ||||
| 		echo "Package already built for version $2 ($existing), installing..." | ||||
| 	fi | ||||
| 	xi $1 | ||||
| 	xi $yes $1 | ||||
| } | ||||
| 
 | ||||
| case $1 in | ||||
|  | @ -99,8 +101,8 @@ case $1 in | |||
| 		fi | ||||
| 
 | ||||
| 		awk '{ printf "\x1b[34m%s\x1b[0m: %s →  \x1b[92m%s\x1b[0m\n", $1, $2, $3 }' <<<"$possible_updates" | ||||
| 		printf "Run updates? [y/N] " | ||||
| 		if read -q; then | ||||
| 		[[ -z $yes ]] && printf "Run updates? [y/N] " | ||||
| 		if [[ $yes ]] || read -q; then | ||||
| 			echo | ||||
| 			for pkg ver in $(cut -d' ' -f 1,3 <<<"$possible_updates"); do | ||||
| 				install_restricted $pkg $ver | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alexander Gehrke
						Alexander Gehrke