Skip to content

Commit

Permalink
Bash allows us to use Source, and then to source load RVM
Browse files Browse the repository at this point in the history
  • Loading branch information
leehambley committed Feb 28, 2013
1 parent 0b9606a commit 1de9a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/runit/service.rb
Expand Up @@ -38,7 +38,7 @@ def sources

def sources_lines
sources.collect do |source|
". #{source}".tap do |s|
"source #{source}".tap do |s|
s.prepend(" "*8) unless sources.first == source
end
end.join("\n")
Expand Down Expand Up @@ -86,7 +86,7 @@ def chdir_line

def run_file
<<-EOHEREDOC.unindent
#!/bin/sh -e
#!/bin/bash -e
exec 2>&1
#{dependencies.any? ? dependency_line : "# No dependencies"}
#{chdir_line || "# No change to pwd" }
Expand Down
8 changes: 4 additions & 4 deletions test/test_service.rb
Expand Up @@ -34,7 +34,7 @@ def test_full_env_options_merges

def test_concise_service_can_print_it_s_own_run_file
sample = <<-EOSCRIPT.unindent
#!/bin/sh -e
#!/bin/bash -e
exec 2>&1
# No dependencies
# No change to pwd
Expand All @@ -49,12 +49,12 @@ def test_concise_service_can_print_it_s_own_run_file

def test_full_service_can_print_it_s_own_run_file
sample = <<-EOSCRIPT.unindent
#!/bin/sh -e
#!/bin/bash -e
exec 2>&1
sv check otherservice
# No change to pwd
. /etc/profile.d/rvm.sh
. /etc/profile.d/protonet.sh
source /etc/profile.d/rvm.sh
source /etc/profile.d/protonet.sh
# http://smarden.org/runit/faq.html#user
chmod 755 ./supervise
chown protonet ./supervise/ok ./supervise/control ./supervise/status
Expand Down

0 comments on commit 1de9a89

Please sign in to comment.