Permalink
Browse files

In case of error, exit with status 1

  • Loading branch information...
1 parent 83d2c05 commit 6d2061573cc98003396846dc791cb7c3fdef54b0 @laurilehmijoki committed Jan 12, 2014
Showing with 21 additions and 2 deletions.
  1. +3 −0 bin/s3_website
  2. +4 −0 changelog.md
  3. +8 −1 features/error_reporting.feature
  4. +5 −0 features/instructions-for-new-user.feature
  5. +1 −1 s3_website.gemspec
View
@@ -8,6 +8,7 @@ class Cfg < Thor
S3Website::Tasks.config_create Dir.pwd
rescue Exception => e
puts S3Website.error_report e
+ exit 1
end
desc 'apply', 'Apply the configuration on the AWS services'
@@ -28,6 +29,7 @@ class Cfg < Thor
})
rescue Exception => e
puts S3Website.error_report e
+ exit 1
end
end
@@ -60,6 +62,7 @@ class Cli < Thor
S3Website::Tasks.push(options[:config_dir], site_path, options[:headless])
rescue Exception => e
puts S3Website.error_report e
+ exit 1
end
desc 'cfg SUBCOMMAND ...ARGS', 'Operate on the config file'
View
@@ -2,6 +2,10 @@
This project uses [Semantic Versioning](http://semver.org).
+## 1.6.5
+
+* In case of error, exit with status 1
+
## 1.6.4
* Add systematic error handling
@@ -5,7 +5,7 @@ Feature: reporting errors to the user
@starts-new-os-process
@network-io
- Scenario: The S3 credentials are invalid
+ Scenario: The user calls "push" when the S3 credentials are invalid
When I run `s3_website push --site ../../features/support/test_site_dirs/my.blog.com --config_dir ../../features/support/test_site_dirs/my.blog.com`
Then the output should contain:
"""
@@ -15,3 +15,10 @@ Feature: reporting errors to the user
"""
throw
"""
+ And the exit status should be 1
+
+ @starts-new-os-process
+ @network-io
+ Scenario: The user calls "cfg apply" when the S3 credentials are invalid
+ When I run `s3_website cfg apply`
+ And the exit status should be 1
@@ -12,6 +12,11 @@ Feature: Instructions for a new user
I can't find a website in any of the following directories: public/output, _site. Please specify the location of the website with the --site option.
"""
+ @starts-new-os-process
+ Scenario: Configuration is incomplete
+ When I run `s3_website push`
+ Then the exit status should be 1
+
@starts-new-os-process
Scenario: Create placeholder config file
Given a directory named "_site"
View
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "s3_website"
- s.version = "1.6.4"
+ s.version = "1.6.5"
s.platform = Gem::Platform::RUBY
s.authors = ["Lauri Lehmijoki"]
s.email = ["lauri.lehmijoki@iki.fi"]

0 comments on commit 6d20615

Please sign in to comment.