Skip to content

Instantly share code, notes, and snippets.

@emad-elsaid
Created May 13, 2017 20:30
Show Gist options
  • Save emad-elsaid/02f8ce30ea88b665f39cef620802e5ba to your computer and use it in GitHub Desktop.
Save emad-elsaid/02f8ce30ea88b665f39cef620802e5ba to your computer and use it in GitHub Desktop.
#!/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