Last active
August 29, 2015 14:00
-
-
Save SteveBenner/11134391 to your computer and use it in GitHub Desktop.
Simple script that generates executable shortcuts from the command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Shortcuttr - generates executable shortcuts | |
# | |
require 'fileutils' | |
SCRIPT = File.join ENV['HOME'], 'github/ruby-scripts/system/bin', ARGV.first.to_s | |
File.open SCRIPT, 'w', 0755 do |f| | |
f.puts '#!/usr/bin/bash' | |
f.puts '# This executable shortcut was generated by Stephen Benner, a truly lazy programmer' | |
f.puts ARGV[1].to_s | |
end | |
FileUtils.symlink SCRIPT, File.join('/usr/local/bin', ARGV.first.to_s), verbose: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment