mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 05:41:37 +00:00
Unlike /usr/bin/env which is a Posix standard, there is no guarentee that /bin/bash exists. This is the case for operating systems such as FreeBSD, NixOS and Guix. By using /usr/bin/env we also give the user the option to provide their own bash in a different path by setting the $PATH environemnt variable. Distributions usually provide their own packaging wrappers to fixup shebangs upon installation, however those are not convienent to use when developing in the source tree. See also other upstream discussions about the topic: - https://github.com/systemd/systemd/pull/5816
18 lines
374 B
Bash
Executable File
18 lines
374 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eu -o pipefail
|
|
|
|
# Creates a test copy where you can check `make clean` without messing with
|
|
# your main dir.
|
|
|
|
top_dir="$(readlink -m "${BASH_SOURCE[0]}/../..")"
|
|
test_dir="$top_dir.clean-check.test"
|
|
|
|
if [ -n "${JENKINS_HOME:-}" ]; then
|
|
test_dir="/tmp/$(basename "$test_dir")"
|
|
fi
|
|
|
|
rm -rf "$test_dir"
|
|
cp -a "$top_dir" "$test_dir"
|
|
echo "$test_dir"
|