-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mattes Groeger
committed
Mar 16, 2014
1 parent
1e5a948
commit 5e356ce
Showing
3 changed files
with
30 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'rake/packagetask' | ||
|
||
task :default => [:release] | ||
|
||
desc "Create release archive" | ||
task :release do | ||
tag = request_user_input("Which tag (0.1.0)?") | ||
`mkdir -p release` | ||
`zip -r release/vim-bookmarks-#{tag}.zip . -i "doc/*" -i "plugin/*" -i LICENSE.txt` | ||
if request_user_input("Create git tag and commit? (y/n)") == 'y' | ||
`git add .` | ||
`git commit -m "Release build #{tag}"` | ||
`git push --tags origin master` | ||
end | ||
end | ||
|
||
def request_user_input(message, fallback = "") | ||
STDOUT.puts message | ||
input = STDIN.gets.strip.to_s | ||
if input.empty? | ||
if fallback.empty? | ||
request_user_input(message) # try again | ||
else | ||
fallback.to_s | ||
end | ||
else | ||
input.to_s | ||
end | ||
end |
Binary file not shown.