fix: cleanup code and comments
This commit is contained in:
parent
ec98b89206
commit
4acbaf7d83
8 changed files with 12 additions and 14 deletions
|
@ -18,7 +18,7 @@ module GX::Commands
|
||||||
# Override the configuration path if provided
|
# Override the configuration path if provided
|
||||||
puts "Configuration file path: #{config_file_path}"
|
puts "Configuration file path: #{config_file_path}"
|
||||||
puts "Configuration file path: #{@config.path}"
|
puts "Configuration file path: #{@config.path}"
|
||||||
pp @config
|
# pp @config
|
||||||
@config.path.try do |path|
|
@config.path.try do |path|
|
||||||
config_file_path = path
|
config_file_path = path
|
||||||
config_dir = File.dirname(path)
|
config_dir = File.dirname(path)
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "../config"
|
||||||
|
|
||||||
module GX::Commands
|
module GX::Commands
|
||||||
class GlobalVersion < AbstractCommand
|
class GlobalVersion < AbstractCommand
|
||||||
def initialize(config : GX::Config) # FIXME
|
def initialize(config : GX::Config)
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
|
|
|
@ -7,7 +7,7 @@ require "./abstract_command"
|
||||||
|
|
||||||
module GX::Commands
|
module GX::Commands
|
||||||
class MappingCreate < AbstractCommand
|
class MappingCreate < AbstractCommand
|
||||||
def initialize(@config : GX::Config) # FIXME
|
def initialize(@config : GX::Config)
|
||||||
@config.load_from_env
|
@config.load_from_env
|
||||||
@config.load_from_file
|
@config.load_from_file
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,11 +7,11 @@ require "./abstract_command"
|
||||||
|
|
||||||
module GX::Commands
|
module GX::Commands
|
||||||
class MappingDelete < AbstractCommand
|
class MappingDelete < AbstractCommand
|
||||||
def initialize(config : GX::Config) # FIXME
|
def initialize(config : GX::Config)
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
# FIXME: implement
|
# TODO: implement
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.handles_mode
|
def self.handles_mode
|
||||||
|
|
|
@ -7,11 +7,11 @@ require "./abstract_command"
|
||||||
|
|
||||||
module GX::Commands
|
module GX::Commands
|
||||||
class MappingEdit < AbstractCommand
|
class MappingEdit < AbstractCommand
|
||||||
def initialize(config : GX::Config) # FIXME
|
def initialize(config : GX::Config)
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
# FIXME: implement
|
# TODO: implement
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.handles_mode
|
def self.handles_mode
|
||||||
|
|
|
@ -27,7 +27,6 @@ module GX
|
||||||
record AddArgs, name : String, path : String
|
record AddArgs, name : String, path : String
|
||||||
record DelArgs, name : String
|
record DelArgs, name : String
|
||||||
|
|
||||||
# getter filesystems : Array(Models::AbstractFilesystemConfig)
|
|
||||||
getter home_dir : String
|
getter home_dir : String
|
||||||
getter root : Models::RootConfig?
|
getter root : Models::RootConfig?
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,3 @@ class FileStorage
|
||||||
|
|
||||||
bake_folder "../static"
|
bake_folder "../static"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,10 @@ module GX
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_open(filesystem)
|
def auto_open(filesystem)
|
||||||
# FIXME: detect xdg-open and use it if possible
|
# TODO: detect xdg-open and use it if possible
|
||||||
# FIXME: detect mailcap and use it if no xdg-open found
|
# TODO: detect mailcap and use it if no xdg-open found
|
||||||
# FIXME: support user-defined command in configuration
|
# TODO: support user-defined command in configuration
|
||||||
# FIXME: detect graphical environment
|
# TODO: detect graphical environment
|
||||||
|
|
||||||
mount_point_safe = filesystem.mount_point
|
mount_point_safe = filesystem.mount_point
|
||||||
raise Models::InvalidMountpointError.new("Invalid filesystem") if mount_point_safe.nil?
|
raise Models::InvalidMountpointError.new("Invalid filesystem") if mount_point_safe.nil?
|
||||||
|
@ -111,7 +111,7 @@ module GX
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# # FIXME: feat: allow to sort by name or by filesystem
|
# FIXME: feat: allow to sort by name or by filesystem
|
||||||
sorted_values = names_display.values.sort_by!(&.[:filesystem].name)
|
sorted_values = names_display.values.sort_by!(&.[:filesystem].name)
|
||||||
result_filesystem_name = Utils::Fzf.run(sorted_values.map(&.[:ansi_name])).strip
|
result_filesystem_name = Utils::Fzf.run(sorted_values.map(&.[:ansi_name])).strip
|
||||||
selected_filesystem = names_display[result_filesystem_name][:filesystem]
|
selected_filesystem = names_display[result_filesystem_name][:filesystem]
|
||||||
|
|
Loading…
Reference in a new issue