Created
May 13, 2017 20:30
-
-
Save emad-elsaid/02f8ce30ea88b665f39cef620802e5ba to your computer and use it in GitHub Desktop.
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 | |
if ['--help', '-h'].include?(ARGV[0]) || ARGV.size != 2 | |
puts <<-EOT | |
Make web application shortcut | |
Usage: makewebapp <name> <URL> | |
EOT | |
exit | |
end | |
name = ARGV.first | |
url = ARGV.last | |
command = "#!/usr/bin/env bash\ngoogle-chrome-stable --app=#{url}" | |
path = File.join(File.dirname(__FILE__), name) | |
File.open(path, "w", 0700) do |f| | |
f.write(command) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment