Skip to content

Commit

Permalink
generate_docs: added option --skip-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Nov 20, 2017
1 parent d600098 commit 424f3e6
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions generate_docs.sh
@@ -1,5 +1,7 @@
#!/bin/bash

# Run with argument `--skip-checks` to skip checks for clean build and removing install dir.

# exit on any error
set -e

Expand All @@ -11,19 +13,26 @@ set -e
# Get current directory of script.
source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

skip_checks=false
if [ "$#" -eq 1 -a "$1" == "--skip-checks" ]; then
skip_checks=true
fi

# We use a local install folder so we don't need sudo.
install_prefix="$source_dir/install"

# We need to do a clean build, otherwise the INSTALL_PREFIX has no effect.
if [ -e $source_dir/build/ ]; then
echo "Build directory ($install_prefix) already exists, you should do 'make clean' first."
exit 1
fi

# Check for leftover install artefacts.
if [ -e $install_prefix ]; then
echo "Install directory ($install_prefix) already exists, you should delete it up first."
exit 1
if [ "$skip_checks" = false ]; then
# We need to do a clean build, otherwise the INSTALL_PREFIX has no effect.
if [ -e $source_dir/build/ ]; then
echo "Build directory ($install_prefix) already exists, you should do 'make clean' first."
exit 1
fi

# Check for leftover install artefacts.
if [ -e $install_prefix ]; then
echo "Install directory ($install_prefix) already exists, you should delete it up first."
exit 1
fi
fi

# Build and install locally.
Expand Down

0 comments on commit 424f3e6

Please sign in to comment.