Skip to content

Commit

Permalink
maintains force_folder option prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Apr 20, 2016
1 parent b2db0c5 commit 79158fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ def run_user_config
# individual config files generated
Dir.mkdir('tmp') unless Dir.exist? 'tmp'
# output folder will be named with database as suffix
output_folder = Time.now.strftime('%Y_%m_%d-%H_%M_%S') +
'-' + srand.to_s[3..6] + '-' + item
if config['force_folder'].nil? || config['force_folder'].strip == ''
output_folder = Time.now.strftime('%Y_%m_%d-%H_%M_%S') +
'-' + srand.to_s[3..6]
else
output_folder = config['force_folder']
end
output_folder += '-' + item
# add .yml to config name
new_config = File.join('tmp', output_folder + '.config.yml')
# write change configuration to file, forcing only a single db
Expand Down

0 comments on commit 79158fb

Please sign in to comment.