Skip to content
Browse files

Fixing "cd &&" issue in running commands on linux

  • Loading branch information...
1 parent c2309f2 commit baa93582502bffd4b726b20089a9c89d7fb61b28 @winton committed Nov 1, 2010
Showing with 6 additions and 2 deletions.
  1. +1 −1 require.rb
  2. +5 −1 templates/bash.erb
View
2 require.rb
@@ -13,7 +13,7 @@
name 'with_pid'
homepage "http://github.com/winton/#{name}"
summary "The simple way to create and monitor a Ruby daemon"
- version '0.1.3'
+ version '0.1.4'
end
rakefile do
View
6 templates/bash.erb
@@ -22,7 +22,11 @@ case "<%= options[:action] %>" in
rm -f $PID_FILE
fi
echo $$ > $PID_FILE;
- exec 2<&1 $COMMAND
+<% if RUBY_PLATFORM.include?('darwin') %>
+ exec 2<&1 "$COMMAND"
+<% else %>
+ exec 2<&1 su -c"$COMMAND"
+<% end %>
;;
stop)
echo "Stopping <%= options[:name] %>"

0 comments on commit baa9358

Please sign in to comment.
Something went wrong with that request. Please try again.