diff options
author | Marie <ml.kochsiek@fu-berlin.de> | 2016-09-22 19:34:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-22 19:34:16 +0200 |
commit | 873ba38715bb0e08f39a1effd64a26e9d05af78b (patch) | |
tree | 7a1472480072f20ccd19b22f1b09b0259efaeff9 /script/generate_bearer_token | |
parent | 22478d315af3590d2a344eb1aa8cf2aec0730506 (diff) | |
parent | d44fc9292637ed6d1a4a7e04883e8b3b88dc3c15 (diff) |
Merge pull request #15 from LoadToCode/thea
errorhandling and small changes
Diffstat (limited to 'script/generate_bearer_token')
-rwxr-xr-x | script/generate_bearer_token | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/script/generate_bearer_token b/script/generate_bearer_token index 7091a8d..3a09382 100755 --- a/script/generate_bearer_token +++ b/script/generate_bearer_token @@ -55,8 +55,8 @@ if options[:projectroot].nil? then puts "You didn't tell us the directory to have your secrets-file created or being filled. Feel free to copy/paste your bearer_token:" puts $bearer_token else - if File.exist?("#{options[:projectroot]}/leap_web/config/secrets.yml") - secrets = YAML.load_file("#{options[:projectroot]}/leap_web/config/secrets.yml") + if File.exist?("#{options[:projectroot]}/config/secrets.yml") + secrets = YAML.load_file("#{options[:projectroot]}/config/secrets.yml") else puts "Please make sure that you created a secrets-file as described in the documentation or have given the correct directory. No secrets-file could be found." exit @@ -73,10 +73,12 @@ else else secrets["development"]["twitter"]["twitter_handle"] = options[:twitterhandle] secrets["test"]["twitter"]["twitter_handle"] = options[:twitterhandle] + secrets["production"]["twitter"]["twitter_handle"] = options[:twitterhandle] end secrets["development"]["twitter"]["bearer_token"] = $bearer_token secrets["test"]["twitter"]["bearer_token"] = $bearer_token + secrets["production"]["twitter"]["twitter_handle"] = $bearer_token File.open("#{options[:projectroot]}/leap_web/config/secrets.yml", "r+") do |file| file.write(secrets.to_yaml) |