Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

wvwatson
Copy link

@wvwatson wvwatson commented Oct 1, 2020

See #15

@@ -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:
Copy link
Owner

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
Copy link
Owner

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 }
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants