diff options
| -rwxr-xr-x | bin/ootb | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/bin/ootb b/bin/ootb deleted file mode 100755 index bf3fb55d..00000000 --- a/bin/ootb +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - ootb BUILD_DIRECTORY < FILE... - ootb -h - EOF -} - -help() { - cat <<-'EOF' - - - Options: - -h, --help show this message - - BUILD_DIRECTORY the path of the build directory - FILE the files to be linked - - - Create a directory out of symlinks of the given files. - - The goal is to enable parallel build directories to coexist, - so that one do *O*ut *O*f *T*ree *B*uilds without requiring the - build system or the project to explicitly support it. - - If a repository contains the files: - - .git/ - Makefile - README.md - src/ - file1.ext - file2.ext - - Running `git ls-files | ootb build-1/` would create the - 'build-1/' directory with: - - build-1/ - Makefile -> ../Makefile - README.md -> ../README.md - src/ - file1.ext -> ../../src/file1.ext - file2.ext -> ../../src/file2.ext - - With that one can `cd build-1/` and run builds there, without - the build artifacts littering the source tree. Also, one could - create a build-2/ directory, where different compiler flags or - build options are given, such as debug/release, while sharing the - underlying source code. - - - Examples: - - Create a 'build/' directory with the files from the Git repository: - - $ git ls-files | ootb build/ - EOF -} - - -for flag in "$@"; do - case "$flag" in - (--) - break - ;; - (--help) - usage - help - exit - ;; - (*) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - (h) - usage - help - exit - ;; - (*) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -BUILD_DIRECTORY="${1:-}" -eval "$(assert-arg -- "$BUILD_DIRECTORY" 'BUILD_DIRECTORY')" -mkdir -p "$BUILD_DIRECTORY" - - -while read -r f; do - mkdir -p "$BUILD_DIRECTORY"/"$(dirname "$f")" - ln -rfs "$PWD"/"$f" "$BUILD_DIRECTORY"/"$f" -done |
