WIP: feature/1-add-support-for-fs-crud #47

Draft
glenux wants to merge 53 commits from feature/1-add-support-for-fs-crud into develop
2 changed files with 12 additions and 0 deletions
Showing only changes of commit 01804f1139 - Show all commits

View file

@ -4,12 +4,14 @@
# Copyright © 2024 Glenn Y. Rolland <glenux@glenux.net>
require "./abstract_command"
require "../models/filesystem_factory"
module GX::Commands
class MappingCreate < AbstractCommand
def initialize(@config : GX::Config)
@config.load_from_env
@config.load_from_file
@config.save_to_file
end
def execute

View file

@ -120,5 +120,15 @@ module GX
end
@root = root
end
def save_to_file
return if @path.nil?
if @path
File.write(@path.to_s, @root.to_yaml)
else
Log.error { "Configuration path is nil, cannot save configuration." }
end
Log.info { "Configuration saved to #{@path}" }
end
end
end