Skip to content
Snippets Groups Projects

Move gitlab-shell to make Go development easier

Merged Jacob Vosmaer (GitLab) requested to merge gitlab-shell-go-symlink into master
3 files
+ 31
3
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 21
0
#!/usr/bin/env ruby
require 'fileutils'
require 'time'
def main(symlink, target)
return if File.symlink?(symlink)
if File.exist?(symlink)
# there is an old directory at the symlink location
FileUtils.mv(symlink, "#{symlink}.#{Time.now.iso8601}")
end
FileUtils.ln_s(target, symlink)
end
if ARGV.count != 2
abort "Usage: #{$0} SYMLINK TARGET"
end
main(*ARGV)
Loading