config & constants: Use constants for default locations.
This commit is contained in:
parent
16f524699f
commit
d113aadcbc
2 changed files with 10 additions and 20 deletions
|
@ -20,27 +20,10 @@ module Qasim
|
|||
|
||||
def initialize
|
||||
|
||||
user = if ENV['USER'] then
|
||||
ENV['USER']
|
||||
else
|
||||
raise "Environment variable 'USER' is missing!"
|
||||
end
|
||||
|
||||
home_dir = if ENV['HOME'] then
|
||||
ENV['HOME']
|
||||
else
|
||||
"/home/" + user
|
||||
end
|
||||
@mnt_dir = File.join ENV['HOME'], "mnt"
|
||||
|
||||
xdg_dir = if ENV['XDG_CONFIG_HOME'] then
|
||||
ENV['XDG_CONFIG_HOME']
|
||||
else
|
||||
home_dir + '/.config'
|
||||
end
|
||||
|
||||
@mnt_dir = File.join home_dir, "mnt"
|
||||
|
||||
@config_dir = xdg_dir + '/sshfs-mapper'
|
||||
@config_dir = APP_CONFIG_DIR
|
||||
@config_file = nil
|
||||
@maps = []
|
||||
@initialize_enable = false
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
module Qasim
|
||||
APP_ICON_PATH = File.join QASIM_INCLUDE_DIR, "icons"
|
||||
APP_SYSCONFIG_DIR = "/etc/qasim/maps.d"
|
||||
APP_NAME = "Qasim"
|
||||
APP_VERSION = "0.1"
|
||||
|
||||
APP_SYSCONFIG_DIR = "/etc/qasim/maps.d"
|
||||
|
||||
APP_CONFIG_DIR = if ENV['XDG_CONFIG_HOME'] then
|
||||
File.join ENV['XDG_CONFIG_HOME'], 'qasim'
|
||||
else
|
||||
File.join ENV['HOME'], '.config', 'qasim'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue