-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default command to cqfd run
, remove command and automatically init when needed
#106
Open
Ballasi
wants to merge
3
commits into
master
Choose a base branch
from
sudoisation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,11 +42,9 @@ Options: | |
-h or --help Show this help text. | ||
|
||
Commands: | ||
init Initialize project build container | ||
flavors List flavors from config file to stdout | ||
run Run argument(s) inside build container | ||
release Run argument(s) and release software | ||
help Show this help text | ||
--init Initialize project build container | ||
--flavors List flavors from config file to stdout | ||
--release Run argument(s) and release software | ||
|
||
By default, run is assumed, and the run command is the one | ||
configured in .cqfdrc. | ||
|
@@ -138,7 +136,7 @@ docker_build() { | |
docker_run() { | ||
|
||
if ! docker image inspect $docker_img_name &> /dev/null; then | ||
die "The docker image doesn't exist, launch 'cqfd init' to create it" | ||
die "The docker image doesn't exist, launch 'cqfd --init' to create it" | ||
fi | ||
|
||
local interactive_options | ||
|
@@ -456,20 +454,20 @@ has_custom_cqfdrc=false | |
has_to_release=false | ||
while [ $# -gt 0 ]; do | ||
case "$1" in | ||
help|-h|"--help") | ||
-h|"--help") | ||
usage | ||
exit 0 | ||
;; | ||
version|-v|"--version") | ||
-v|"--version") | ||
echo $VERSION | ||
exit 0 | ||
;; | ||
init) | ||
"--init") | ||
config_load $flavor | ||
docker_build | ||
exit $? | ||
;; | ||
flavors) | ||
"--flavors") | ||
config_load | ||
echo $build_flavors | ||
exit 0 | ||
|
@@ -494,43 +492,33 @@ while [ $# -gt 0 ]; do | |
-q) | ||
quiet=true | ||
;; | ||
run|release) | ||
if [ "$1" = "release" ]; then | ||
has_to_release=true | ||
fi | ||
|
||
shift | ||
|
||
# No more args? run default command | ||
[ "$#" -eq 0 ] && break | ||
|
||
# -c appends following args to the default command | ||
if [ "$1" = "-c" ]; then | ||
if [ $# -lt 2 ]; then | ||
die "option -c requires arguments" | ||
fi | ||
|
||
shift | ||
build_cmd_append="$*" | ||
break | ||
fi | ||
|
||
# Run alternate command | ||
build_cmd_alt="$@" | ||
break | ||
;; | ||
?*) | ||
echo "Unknown command: $1" | ||
usage | ||
exit 1 | ||
"--release") | ||
has_to_release=true | ||
;; | ||
*) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be out of scope, but can we support |
||
# empty or no argument case | ||
# run a command | ||
break | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
# No more args? run default command | ||
if [ "$#" -ne 0 ]; then | ||
# -c appends following args to the default command | ||
if [ "$1" = "-c" ]; then | ||
if [ $# -lt 2 ]; then | ||
die "option -c requires arguments" | ||
fi | ||
|
||
shift | ||
build_cmd_append="$*" | ||
else | ||
# Run alternate command | ||
build_cmd_alt="$@" | ||
fi | ||
fi | ||
|
||
config_load $flavor | ||
|
||
if [ -n "$build_cmd_alt" ]; then | ||
|
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these 3 now be in the
Options:
section?