Skip to content

Instantly share code, notes, and snippets.

@banyan
Last active December 13, 2015 16:58
Show Gist options
  • Select an option

  • Save banyan/4943864 to your computer and use it in GitHub Desktop.

Select an option

Save banyan/4943864 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'fileutils'
path = "#{ENV['HOME']}/current/uploads"
if File.directory?(path)
FileUtils.mv(path, "#{path}.old")
elsif File.symlink?(path)
FileUtils.rm(path)
end
FileUtils.symlink("#{ENV['HOME']}/uploads", path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment