generated from cisagov/ScubaGear
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: create output directory if non-existent
- Loading branch information
Showing
1 changed file
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -55,6 +56,7 @@ do | |
;; | ||
o) | ||
outDir=$(realpath "$OPTARG") | ||
mkdir -p "$outDir" | ||
;; | ||
r) | ||
scubaGogglesGit="$OPTARG" | ||
|
@@ -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 |