From 21ea4c340d682c706853238b23023a6f9d35afbb Mon Sep 17 00:00:00 2001 From: R S Nikhil Krishna Date: Tue, 10 Jul 2018 18:10:22 +0200 Subject: [PATCH] Added $AUTOINSTALL for usability in other scripts Added an optional AUTOINSTALL parameter that makes it easier to integrate this script in other scripts for automation (user need not wait to press yes when asked. Also fixed outdated README in the "Common Installation" section --- README.md | 10 +++++----- build-ffmpeg | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6c7a54cb..9c4d8e59 100644 --- a/README.md +++ b/README.md @@ -58,23 +58,23 @@ Installation Open your command line and run (needs curl to be installed): -``` -bash <(curl -s https://raw.githubusercontent.com/markus-perl/ffmpeg-build-script/master/web-install.sh?v1) +```bash +bash <(curl -s "https://raw.githubusercontent.com/markus-perl/ffmpeg-build-script/master/web-install.sh?v1") ``` This command downloads the build script and automatically starts the build process. ### Common installation -``` +```bash git clone https://github.com/markus-perl/ffmpeg-build-script.git cd ffmpeg-build-script -./ffmpeg-build-script --help +./build-ffmpeg --help ``` Usage ------ -``` +```bash ./build-ffmpeg --help Display usage information ./build-ffmpeg --build Starts the build process ./build-ffmpeg --cleanup Remove all working dirs diff --git a/build-ffmpeg b/build-ffmpeg index fabc01b9..dfbf00c9 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -384,7 +384,13 @@ echo "Building done. The binary can be found here: $WORKSPACE/bin/ffmpeg" echo "" -if [[ ! $SKIPINSTALL == "yes" ]]; then +if [[ $AUTOINSTALL == "yes" ]]; then + if command_exists "sudo"; then + sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg" + sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe" + echo "Done. ffmpeg is now installed to your system" + fi +elif [[ ! $SKIPINSTALL == "yes" ]]; then if command_exists "sudo"; then read -r -p "Install the binary to your $INSTALL_FOLDER folder? [Y/n] " response