ensure cache folder when requiring dirs file
This commit is contained in:
parent
0000dd1bf7
commit
417be1c910
|
@ -44,7 +44,6 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
|
|||
}
|
||||
|
||||
def run
|
||||
ensure_cache_folder
|
||||
validate_options!
|
||||
parse_tmux_conf
|
||||
setup_bindings
|
||||
|
@ -162,10 +161,6 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
|
|||
true
|
||||
end
|
||||
|
||||
def ensure_cache_folder
|
||||
FileUtils.mkdir_p(Fingers::Dirs::CACHE) unless File.exists?(Fingers::Dirs::CACHE)
|
||||
end
|
||||
|
||||
def fingers_options_names
|
||||
@fingers_options_names ||= `tmux show-options -g | grep ^@fingers`.chomp.split("\n").map { |line| line.split(" ")[0] }
|
||||
end
|
||||
|
|
|
@ -9,4 +9,7 @@ module Fingers::Dirs
|
|||
CACHE = ROOT / "tmux-fingers"
|
||||
CONFIG_PATH = CACHE / "config.json"
|
||||
SOCKET_PATH = CACHE / "fingers.sock"
|
||||
|
||||
# ensure cache folder
|
||||
FileUtils.mkdir_p(Fingers::Dirs::CACHE) unless File.exists?(Fingers::Dirs::CACHE)
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require "log"
|
||||
require "../fingers/dirs"
|
||||
|
||||
module Fingers
|
||||
Log.setup(:debug, Log::IOBackend.new(File.new(Dirs::LOG_PATH, "a+")))
|
||||
|
|
Loading…
Reference in New Issue