From bd44a20c60ee7943779ecfd14b9defe611e33b5e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 21 Jun 2014 04:42:57 -0400 Subject: [PATCH] Add do_link helper --- rake/lib/sh.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rake/lib/sh.rb b/rake/lib/sh.rb index e9a80695..8b18fb95 100644 --- a/rake/lib/sh.rb +++ b/rake/lib/sh.rb @@ -12,3 +12,9 @@ def sh_safe(cmd) return false end end + +def do_link(src, dest) + if not (File.exist?(path_to_file) || File.symlink?(path_to_file)) + sh_safe "ln -sf #{src} #{dest}" + end +end