vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / os-specific / bsd / lib / install-wrapper.sh
blob97a2aaab22c0eb2af8b91a4a7bac76f54385cde3
1 set -eu
3 args=()
4 declare -i path_args=0
6 while (( $# )); do
7 if (( $# == 1 )); then
8 if (( path_args > 1)) || [[ "$1" = */ ]]; then
9 mkdir -p "$1"
10 else
11 mkdir -p "$(dirname "$1")"
14 case $1 in
15 -C) ;;
16 -o | -g) shift ;;
17 -m | -l)
18 # handle next arg so not counted as path arg
19 args+=("$1" "$2")
20 shift
22 -*) args+=("$1") ;;
24 path_args+=1
25 args+=("$1")
27 esac
28 shift
29 done