fix error

This commit is contained in:
邱博亞 2021-11-18 09:34:36 +08:00
parent e5ae451eb7
commit 6807b93489
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "announcement/version"
require 'json'
require 'yaml'
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
if bundle_update_flag
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
if !secret_key.nil?
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)
end
end