Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: master
...
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 13 additions and 3 deletions.
  1. +13 −3 lib/sake.rb
View
16 lib/sake.rb
@@ -98,6 +98,11 @@ def initialize(args)
# (like version, which prints a Sake version then trusts Rake to do
# likewise).
def run
+ if index = @args.index("--force")
+ @args.delete("--force")
+ @force = true
+ end
+
##
# Show Sake tasks in the store or in a file, optionally searching for a pattern.
# $ sake -T
@@ -195,12 +200,17 @@ def install(index)
# No duplicates.
tasks.each do |task|
- if Store.has_task? task
+ if Store.has_task?(task) && !@force
puts "# Task `#{task}' already exists in #{Store.path}"
+ next
+ elsif Store.has_task?(task)
+ puts "# Task `#{task}' already exists. Updating it."
+ Store.remove_task(task)
else
- puts "# Installing task `#{task}'"
- Store.add_task task
+ puts "# Installing task `#{task}'"
end
+
+ Store.add_task task
end
# Commit.

No commit comments for this range

Something went wrong with that request. Please try again.