helm/rake/lib/sh.rb

20 lines
434 B
Ruby
Raw Normal View History

2014-06-15 22:24:05 -07:00
require_relative 'output'
# A 'safe' sh function that won't stop rake in its tracks
# when it encounters a problem. I'll leave it up to the
# programmer to expect problems and terminate when necessary.
def sh_safe(cmd)
2014-09-05 14:01:52 -07:00
begin
return sh(cmd)
rescue
error $!
return false
end
2014-06-15 22:24:05 -07:00
end
2014-06-21 01:42:57 -07:00
def do_link(src, dest)
2014-09-05 14:01:52 -07:00
if not (File.exist?(path_to_file) || File.symlink?(path_to_file))
sh_safe "ln -sf #{src} #{dest}"
end
2014-06-21 01:42:57 -07:00
end