Permalink
Browse files

unrevert fix to CLI to not overwrite config/final.yml unless it has c…

…hanged
  • Loading branch information...
1 parent ad60ba5 commit 37efb916bf027412a68a6c894f5dd41121ecf0be Amit Gupta committed Mar 29, 2013
Showing with 13 additions and 11 deletions.
  1. +10 −8 bosh_cli/lib/cli/release.rb
  2. +3 −3 spec/assets/test_release_template/config/final.yml
@@ -111,14 +111,8 @@ def blobstore
end
def save_config
- # TODO: introduce write_yaml helper
- File.open(@dev_config_file, "w") do |f|
- Psych.dump(@dev_config, f)
- end
-
- File.open(@final_config_file, "w") do |f|
- Psych.dump(@final_config, f)
- end
+ write_yaml(@dev_config_file, @dev_config)
+ write_yaml(@final_config_file, @final_config)
end
private
@@ -224,6 +218,14 @@ def load_config(file)
end
end
+ def write_yaml(file, hash)
+ unless hash == load_config(file)
+ File.open(file, "w+") do |f|
+ Psych.dump(hash, f)
+ end
+ end
+ end
+
end
end
@@ -1,5 +1,5 @@
----
+---
min_cli_version: "0.12"
-blobstore:
+blobstore:
provider: atmos
- options:
+ options:

0 comments on commit 37efb91

Please sign in to comment.