Skip to content

Commit

Permalink
Merge pull request facebook#27 from jaymzh/config_dir
Browse files Browse the repository at this point in the history
[BM] Make config directory rather than crashing.
  • Loading branch information
odcinek committed Jun 26, 2014
2 parents bd939dd + bbc1b36 commit 58bb71d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions between-meals/knife.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def databag_delete(databags)
end

def write_user_config
# rubocop:disable LineLength
cfg = <<-BLOCK
user = ENV['USER']
log_level :info
Expand All @@ -123,7 +122,9 @@ def write_user_config
cfg << " \"#{dir}\",\n"
end
cfg << "]\n"
# rubocop:enable LineLength
unless File.directory?(File.dirname(@config))
Dir.mkdir(File.dirname(@config), 0755)
end
unless File.exists?(@config)
@logger.debug("Generating #{@config}")
File.write(@config, cfg)
Expand Down

0 comments on commit 58bb71d

Please sign in to comment.