aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/develop/hub_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/develop/hub_options.rb')
-rw-r--r--lib/sisu/develop/hub_options.rb35
1 files changed, 32 insertions, 3 deletions
diff --git a/lib/sisu/develop/hub_options.rb b/lib/sisu/develop/hub_options.rb
index f6a40be9..1c3f4e3d 100644
--- a/lib/sisu/develop/hub_options.rb
+++ b/lib/sisu/develop/hub_options.rb
@@ -152,9 +152,9 @@ module SiSU_Commandline
end
end
class Options
- attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod
+ attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod,:sisu_run_path,:sisu_install_type
@@act=nil
- def initialize(a,call_path)
+ def initialize(a,sisu_runtime)
@opt_ch=@f_pth=@pth=@fno=@fns=@fnb=@fnc=@fng=@fncb=@what=@lng=@lng_base=@call_path=@base_path=@base_stub=@image_src_path=@sub_location=''
@f_pths,@files,@files_mod,@paths,@select_arr,@act=Array.new(5){[]}
@select_str=nil
@@ -162,7 +162,9 @@ module SiSU_Commandline
@lng_base=@env.language_default_set
@dir_structure_by=SiSU_Env::EnvCall.new.output_dir_structure.by?
@lingual=SiSU_Env::EnvCall.new.mono_multi_lingual?
- @call_path=call_path
+ @sisu_run_from=sisu_runtime[:runtime_path]
+ @sisu_install_type=sisu_runtime[:runtime_type]
+ @call_path=sisu_runtime[:call_path]
pth=SiSU_Utils::Path.new(call_path)
@base_path=pth.base_markup
@base_stub=pth.base_markup_stub
@@ -173,6 +175,33 @@ module SiSU_Commandline
@make_instructions_pod=nil
init
end
+ def sisu_called_from?
+ @call_path
+ end
+ def sisu_bin_filepath?
+ @sisu_run_from
+ end
+ def sisu_install_type?
+ @sisu_install_type
+ end
+ def sisu_lib_dir?
+ File.dirname(__FILE__)
+ end
+ def sisu_data_dir?
+ env=RbConfig::CONFIG
+ if sisu_install_type? ==:full_path_to_sisu_bin_in_sisu_dir_tree
+ sisu_bin_filepath?.gsub(/\/bin\/sisu\S*/,'/data/sisu')
+ #sisu_lib_dir?.gsub(/\/lib\/sisu\/(?:current|develop)\S*/,'/data/sisu')
+ elsif sisu_install_type? ==:gem_install
+ #sisu_run_from?.gsub(/\/bin\/.+/,'/data/sisu')
+ env['datadir']
+ elsif sisu_install_type? ==:system_install
+ #SiSU_Info_Env::InfoEnv.new.path.share
+ env['datadir']
+ else
+ env['datadir']
+ end
+ end
def find_all(find_flag,opt)
if find_flag
x=Dir.glob('*.ss[tm]')