fix error
This commit is contained in:
parent
e5ae451eb7
commit
6807b93489
|
@ -4,6 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
||||||
# Maintain your gem's version:
|
# Maintain your gem's version:
|
||||||
require "announcement/version"
|
require "announcement/version"
|
||||||
require 'json'
|
require 'json'
|
||||||
|
require 'yaml'
|
||||||
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
|
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
|
||||||
if bundle_update_flag
|
if bundle_update_flag
|
||||||
env_pwd = ENV['PWD']
|
env_pwd = ENV['PWD']
|
||||||
|
@ -164,7 +165,8 @@ if bundle_update_flag
|
||||||
secret_key = r.scan(/Orbit::Application\.config\.secret_key_base = '(.*)'/).flatten[0] rescue nil
|
secret_key = r.scan(/Orbit::Application\.config\.secret_key_base = '(.*)'/).flatten[0] rescue nil
|
||||||
if !secret_key.nil?
|
if !secret_key.nil?
|
||||||
open("#{env_pwd}/config/secrets.yml",'w+') do |f|
|
open("#{env_pwd}/config/secrets.yml",'w+') do |f|
|
||||||
c = {"production"=> {"secret_key_base"=> secret_key},"development"=> {"secret_key_base"=> secret_key}}.to_yaml.sub("---\n",'')
|
c = {"production"=> {"secret_key_base"=> secret_key},"development"=> {"secret_key_base"=> secret_key}}
|
||||||
|
c = c.to_yaml.sub("---\n",'')
|
||||||
f.write(c)
|
f.write(c)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue