-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): Improve build scripts, configure bootstrap.sh (#4040)
- Loading branch information
1 parent
4af0ee3
commit b4221b4
Showing
5 changed files
with
111 additions
and
51 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
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Save the arguments on the first `source ./tools/parse_args "$@"` call. | ||
ARGS=("$@") | ||
|
||
function containsArg() { | ||
for arg in "${ARGS[@]}"; do | ||
if [[ "$arg" == "$1" ]]; then | ||
return 0 | ||
fi | ||
done | ||
return 1 | ||
} | ||
|
||
function isHelp() { | ||
if containsArg "--help" || containsArg "-h"; then | ||
return 0 | ||
fi | ||
return 1 | ||
} | ||
|
||
function noArgs() { | ||
if [[ "${#ARGS}" -eq 0 ]]; then | ||
return 0 | ||
fi | ||
return 1 | ||
} | ||
|
||
# Whether the command line arguments contain a target. | ||
# Returns `true` if either no arguments are specified, or `all`, or the exact target specified. | ||
function isTargetSpecified() { | ||
if noArgs || containsArg "all" || containsArg "$1"; then | ||
return 0 | ||
fi | ||
return 1 | ||
} |
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