From ced3168471c0c3cc0edd63270ae373eadf456c44 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Fri, 25 Oct 2024 17:33:07 +0200 Subject: [PATCH] STASH --- src/commands/config_init.cr | 10 ++++++++++ src/commands/mapping_mount.cr | 1 - src/config.cr | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/commands/config_init.cr b/src/commands/config_init.cr index 07e5eb8..e4fe50e 100644 --- a/src/commands/config_init.cr +++ b/src/commands/config_init.cr @@ -10,6 +10,16 @@ module GX::Commands config_dir = File.join(@config.home_dir, ".config", "mfm") config_file_path = File.join(config_dir, "config.yml") + # Override the configuration path if provided + puts "Configuration file path: #{config_file_path}" + puts "Configuration file path: #{@config.path}" + pp @config + @config.path.try do |path| + config_file_path = path + config_dir = File.dirname(path) + end + exit 1 + # Guard condition to exit if the configuration file already exists if File.exists?(config_file_path) puts "Configuration file already exists at #{config_file_path}. No action taken." diff --git a/src/commands/mapping_mount.cr b/src/commands/mapping_mount.cr index a750c7a..8dcadb4 100644 --- a/src/commands/mapping_mount.cr +++ b/src/commands/mapping_mount.cr @@ -14,7 +14,6 @@ module GX::Commands def execute filesystem = @file_system_manager.choose_filesystem raise Models::InvalidFilesystemError.new("Invalid filesystem") if filesystem.nil? - # @file_system_manager.mount_or_umount(filesystem) filesystem.mount @file_system_manager.auto_open(filesystem) if filesystem.mounted? && @config.auto_open end diff --git a/src/config.cr b/src/config.cr index 12f6b8c..d56ac18 100644 --- a/src/config.cr +++ b/src/config.cr @@ -10,6 +10,10 @@ require "./types/modes" require "./parsers/options/help_options" require "./parsers/options/config_options" require "./parsers/options/config_init_options" +require "./parsers/options/mapping_create_options" +require "./parsers/options/mapping_delete_options" +require "./parsers/options/mapping_mount_options" +require "./parsers/options/mapping_umount_options" require "./commands/abstract_command" module GX