diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-10-03 00:15:31 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-10-03 00:15:31 -0400 |
commit | ac4a6aaa1f4db1237f2a0192a5dc63c8c4057be9 (patch) | |
tree | d4147b4096aea00b6236a81aba962830c6b8400a /bin/sisu3 | |
parent | v4: 4.0.0 new branch & version & changelog "opened" (diff) |
v4: bin/sisu $0, make possible to run sisu command on/within project dir tree
* (previously sisu needed to be correctly installed with system paths honored)
* NOTE: loading of skins turned off
Diffstat (limited to 'bin/sisu3')
-rw-r--r-- | bin/sisu3 | 37 |
1 files changed, 36 insertions, 1 deletions
@@ -41,6 +41,15 @@ WOK rbv_sisu_dev='1.9.2' ruby_version_ok?(rbv_sisu_dev) end + def require_hub_path(sisu_path_specified_lib_) + sisu_path_lib=if sisu_path_specified_lib_ \ + && FileTest.file?("#{sisu_path_specified_lib_}/#{SiSU_lib}/hub.rb") + "#{sisu_path_specified_lib_}/#{SiSU_lib}" + else + SiSU_lib + end + end +#% sisu branch $VERBOSE=nil $KCODE='u' if RUBY_VERSION < '1.9' argv=$* @@ -58,8 +67,34 @@ WOK check_sisu_stable_ruby_version? 'v3' end +#% $0 + e=Config::CONFIG + SiSU_lib="sisu/#{SiSU_version_dir}" + sisu_path_specified_lib_=if $0 =~ /^#{e['bindir']}\/sisu[34]?$/ + nil + elsif $0 !~ /^#{e['bindir']}\/sisu[34]?$/ \ + && $0 =~/bin\/sisu[34]?$/ \ + && FileTest.file?($0) + $0.sub(/bin\/sisu[34]?$/,'lib'). + sub(/^lib$/,"#{Dir.pwd}/lib") + elsif $0 !~ /^#{e['bindir']}\/sisu[34]?$/ \ + && $0 =~/^sisu[34]?$/ \ + && FileTest.file?($0) + $0.sub(/sisu[34]?$/,'../lib') + #bug, relative path does not work for sisu version information + else + nil + end + SiSU_path_specified_Version_=if sisu_path_specified_lib_ + sisu_path_specified_lib_.sub(/\/lib/, + "/data/sisu/#{SiSU_version_dir}/v/version.yml") + else + nil + end + SiSU_path_lib="#{require_hub_path(sisu_path_specified_lib_)}" +#% SiSU_lib="sisu/#{SiSU_version_dir}" - require "#{SiSU_lib}/hub" + require "#{SiSU_path_lib}/hub" SiSU::HubMaster.new(argv) rescue STDERR.puts 'ERROR' |