Browse Source

Move config file in own directory

tags/v0.2.0
aeris 1 year ago
parent
commit
51904f3808
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      lib/cross-post/config.rb

+ 4
- 1
lib/cross-post/config.rb View File

@@ -2,8 +2,11 @@ require 'yaml'

class CrossPost
class Config
DEFAULT_CONFIG = File.join Dir.home, '.config/cross-post/config.yml'

def initialize
@file = ENV.fetch 'CROSS_POST_CONFIG', File.join(Dir.home, '.cross-post.yml')
@file = ENV.fetch 'CROSS_POST_CONFIG', DEFAULT_CONFIG
raise 'Unable to find config file' unless File.readable? @file
File.open(@file) { |f| @config = YAML.safe_load f }
end


Loading…
Cancel
Save