Skip to content

Commit 455a192

Browse files
authored
Merge pull request #236 from NicholasFlamy/add-skip-and-auto-install-options
add --skip-install and --auto-install options
2 parents 30c49ce + 661cb3c commit 455a192

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build-ffmpeg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ usage() {
237237
echo " --small Prioritize small size over speed and usability; don't build manpages"
238238
echo " --full-static Build a full static FFmpeg binary (eg. glibc, pthreads etc...) **only Linux**"
239239
echo " Note: Because of the NSS (Name Service Switch), glibc does not recommend static links."
240+
echo " --skip-install Don't install FFmpeg, FFprobe, and FFplay binaries to your system"
241+
echo " --auto-install Install FFmpeg, FFprobe, and FFplay binaries to your system"
242+
echo " Note: Without --skip-install or --auto-install the script will prompt you to install."
240243
echo ""
241244
}
242245

@@ -286,6 +289,20 @@ while (($# > 0)); do
286289
CONFIGURE_OPTIONS+=("--enable-small" "--disable-doc")
287290
MANPAGES=0
288291
fi
292+
if [[ "$1" == "--skip-install" ]]; then
293+
SKIPINSTALL=yes
294+
if [[ "$AUTOINSTALL" == "yes" ]]; then
295+
echo "Error: The option --skip-install cannot be used with --auto-install"
296+
exit 1
297+
fi
298+
fi
299+
if [[ "$1" == "--auto-install" ]]; then
300+
AUTOINSTALL=yes
301+
if [[ "$SKIPINSTALL" == "yes" ]]; then
302+
echo "Error: The option --auto-install cannot be used with --skip-install"
303+
exit 1
304+
fi
305+
fi
289306
shift
290307
;;
291308
*)
@@ -1120,13 +1137,16 @@ echo ""
11201137
INSTALL_NOW=0
11211138
if [[ "$AUTOINSTALL" == "yes" ]]; then
11221139
INSTALL_NOW=1
1140+
echo "Automatically installing these binaries because the --auto-install option was used or AUTOINSTALL=yes was run."
11231141
elif [[ ! "$SKIPINSTALL" == "yes" ]]; then
11241142
read -r -p "Install these binaries to your $INSTALL_FOLDER folder? Existing binaries will be replaced. [Y/n] " response
11251143
case $response in
11261144
"" | [yY][eE][sS] | [yY])
11271145
INSTALL_NOW=1
11281146
;;
11291147
esac
1148+
else
1149+
echo "Skipping install of these binaries because the --skip-install option was used or SKIPINSTALL=yes was run."
11301150
fi
11311151

11321152
if [ "$INSTALL_NOW" = 1 ]; then

0 commit comments

Comments
 (0)