Skip to content

Commit

Permalink
build: create output directory if non-existent
Browse files Browse the repository at this point in the history
  • Loading branch information
rlxdev committed Nov 22, 2024
1 parent cec7e9f commit bdb1749
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scubagoggles/utils/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ scubaGogglesGit='[email protected]:mitre/CISA-SCuBA-GWS-SCB.git'

usage()
{
printf "script usage: %s [options]\n\n" "$(basename "$0")" >&2
printf " -h: display usage and exit\n"
printf " -o <dir>: create package files in this directory\n"
printf 'script usage: %s [options]\n\n' "$(basename "$0")" >&2
printf ' -h: display usage and exit\n'
printf ' -o <dir>: create package files in this directory\n'
printf ' (creates directory if non-existent)\n'
printf ' defaults to %s\n' "$outDir"
printf " -r <git-repo>: ScubaGoggles Git repository specification\n"
printf ' -r <git-repo>: ScubaGoggles Git repository specification\n'
printf ' defaults to %s\n' "$scubaGogglesGit"
printf " -t <git-tag-or-branch>: checkout tag or branch for build\n"
printf " defaults to top of main branch\n"
printf ' -t <git-tag-or-branch>: checkout tag or branch for build\n'
printf ' defaults to top of main branch\n'
}

while getopts ':ho:r:t:' option
Expand All @@ -55,6 +56,7 @@ do
;;
o)
outDir=$(realpath "$OPTARG")
mkdir -p "$outDir"
;;
r)
scubaGogglesGit="$OPTARG"
Expand Down Expand Up @@ -141,5 +143,5 @@ tarFile=$(realpath dist/scubagoggles-*.tar.gz)
for file in "$wheelFile" "$tarFile"
do
echo "$buildPfx Copying $file to $outDir"
cp "$file" "$outDir"
cp "$file" "$outDir/$(basename "$file")"
done

0 comments on commit bdb1749

Please sign in to comment.