Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit c0f1f98

Browse files
committed
Add support for user specific database configuration
1 parent f8fe3b5 commit c0f1f98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

db/env.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
ENV['WPXF_ENV'] = 'development' unless ENV['WPXF_ENV']
44

5-
db_config_path = File.join(__dir__, 'config.yml')
5+
# Use the configuration file found in ~/.wpxf/db/config.yml primarily
6+
# and fall back onto the packaged configuration in db/config.yml.
7+
db_config_path = File.join(Wpxf.home_directory, 'db', 'config.yml')
8+
db_config_path = File.join(__dir__, 'config.yml') unless File.exist?(db_config_path)
69
db_config = YAML.load_file(db_config_path)[ENV['WPXF_ENV']]
710

811
if db_config['database'].nil?

0 commit comments

Comments
 (0)