-
Notifications
You must be signed in to change notification settings - Fork 14
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
Skip tasks v0.4.0 #16
base: master
Are you sure you want to change the base?
Conversation
@@ -63,6 +63,12 @@ To see a list of all available tasks with their descriptions: | |||
$ crystal sam.cr help | |||
``` | |||
|
|||
To skip a task or prerequisite task: |
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.
Let's maybe make it a bit more clear:
To skip a task or prerequisite task specify it's path with "~" prefix
@@ -52,6 +52,12 @@ describe Sam do | |||
Container.tasks.should eq(["db:schema", "db:with_argument"]) | |||
end | |||
end | |||
context "with arguments" do |
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.
please add an empty line between blocks
@@ -35,6 +35,7 @@ module Sam | |||
|
|||
# Launch current task. Prerequisites are invoked first. | |||
def call(args : Args) | |||
return if args.raw.find {|x| "~#{path}" == x } |
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.
Let's grep all tasks that need to be skipped in Args
class constructor into @ignore_tasks
variable (and remove ~
from the beginning). This way #raw
doesn't include any Sam arguments and here we can do args.ignore_tasks.include?(path)
P.S. Also add an empty line after guard clause
See #15