Skip to content

Commit

Permalink
enable legacy capture syntax with deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mroth committed May 17, 2017
1 parent 7de4fe7 commit 8a8c7c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions bin/lolcommits
Expand Up @@ -9,6 +9,13 @@ end

require 'lolcommits/cli/commands/lolcommits'

# DEPRECATION HACK -- MANUALLY CHECK FOR AND MODIFY
if ARGV[0] == '--capture'
STDERR.puts "DEPRECATION WARNING: `lolcommits --capture` syntax is deprecated.\n" \
"See `lolcommits capture --help` or disable & re-enable your hooks.\n\n"
ARGV[0] = 'capture'
end

Lolcommits::CLI::LolcommitsCommand.run

# #
Expand Down
8 changes: 6 additions & 2 deletions features/capture.feature
Expand Up @@ -19,9 +19,13 @@ Feature: Capture command
When I successfully run `lolcommits capture --help`
Then the output should not contain "--animate"

@wip
Scenario: Legacy capture syntax should work with deprecation warning
Given a pending test
Given I am in a git repo named "myrepo"
And I do a git commit
When I run `lolcommits --capture`
Then the stderr should contain "DEPRECATION WARNING"
Then the output should contain "*** Preserving this moment in history."
And there should be exactly 1 jpg in "~/.lolcommits/myrepo"

Scenario: Basic capture should function
Given I am in a git repo named "myrepo"
Expand Down

0 comments on commit 8a8c7c1

Please sign in to comment.