29 lines
595 B
Crystal
29 lines
595 B
Crystal
def password_file
|
|
# Return password file path
|
|
|
|
begin
|
|
file_path = "#{ENV["PMNG_PWD_FILE"]}"
|
|
file_path.to_s
|
|
rescue KeyError
|
|
file_path = "#{ENV["HOME"]}/.pwd.yml"
|
|
file_path.to_s
|
|
end
|
|
end
|
|
|
|
def input_timeout
|
|
# Return user input timeout
|
|
|
|
user_input_timeout = 60
|
|
|
|
begin
|
|
user_input_timeout = "#{ENV["PMNG_TIMEOUT"]}"
|
|
user_input_timeout.to_i
|
|
rescue KeyError
|
|
user_input_timeout.to_i # return default 60s
|
|
end
|
|
end
|
|
|
|
VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }}
|
|
PASSWORD_FILE_PATH = password_file()
|
|
USER_INPUT_TIMEOUT = input_timeout()
|