Skip to content

Commit 93af3a5

Browse files
committed
Move context/ to share/oswitch/. Concatenate with PREFIX to get absolute path.
PREFIX is declared in lib/oswitch/pkg.rb. The idea is that when building .deb (and maybe .rpm in future) we just swap this file with another that overrides PREFIX to be /usr or so. Signed-off-by: Anurag Priyam <[email protected]>
1 parent 3591d0e commit 93af3a5

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

lib/oswitch.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'fileutils'
44
require 'shellwords'
55

6+
require 'oswitch/pkg'
7+
68
# OSwitch leverages docker to provide access to complex Bioinformatics software
79
# (even Biolinux!) in just one command.
810
#
@@ -239,7 +241,7 @@ def context_dir
239241

240242
# Location of template dir.
241243
def template_dir
242-
File.expand_path('../context/', File.dirname(__FILE__))
244+
File.join(PREFIX, 'share', 'oswitch', 'context')
243245
end
244246

245247
# Template files.

lib/oswitch/pkg.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class OSwitch
2+
PREFIX = File.expand_path('../..', File.basename(__FILE__))
3+
end
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)