implement adding users

This commit is contained in:
Artur Gurgul1 2025-08-07 17:36:47 +02:00
parent 0f9f1a84f9
commit bc0f9db31d
4 changed files with 34 additions and 5 deletions

View file

@ -15,14 +15,21 @@ require 'ostruct'
# dat command service zulip
module Execute
attr_accessor :options
def context(new_value = nil)
@options = new_value
end
class ServiceInstallContext
attr_accessor :bin_dir, :data_dir, :version, :user_name
attr_accessor :bin_dir, :data_dir, :version, :user_name, :forced
def initialize(bin_dir, data_dir, user_name, version)
def initialize(bin_dir, data_dir, user_name, version, forced = false)
@bin_dir = bin_dir
@data_dir = data_dir
@user_name = user_name
@version = version
@forced = forced
end
end
@ -73,7 +80,7 @@ module Execute
bin_dir = pdata.get_prefix
data_dir = "/data/#{pdata.name}/#{pdata.version.split(".").first}"
service_install_context = ServiceInstallContext.new(
bin_dir, data_dir, name, pdata.version
bin_dir, data_dir, name, pdata.version, @options.forced
)
case name
@ -130,6 +137,7 @@ module Execute
def self.file(options)
dsl = Object.new
dsl.extend(Execute)
dsl.options = options
# Configfile
path = File.join(Dir.pwd, options.name || "./Configfile")