lib/scripto/file_commands.rb
def ln_if_necessary(src, dst)
      if File.symlink?(dst)
        return if src == File.readlink(dst)
        rm(dst)
      end

      ln(src, dst)
      true
    end
def ln_if_necessary(src, dst)
      if File.symlink?(dst)
        return if src == File.readlink(dst)
        rm(dst)
      end

      ln(src, dst)
      true
    end
Runs #ln, but ONLY if +dst+ isn't a symlink or differs from +src+.
 Returns true if the file had to be symlinked. This is useful with
 verbose?, to get an exact changelog.