-
-
Save webcracy/340208 to your computer and use it in GitHub Desktop.
ss is a ./script/server shortcut
This file contains 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/local/bin/ruby | |
# | |
# Name: ss | |
# Description: ss is a ./script/server shortcut | |
# Author: Alex Solleiro <[email protected]> | |
# Instructions: | |
# Save this file as 'ss' within a directory in your $PATH | |
# Make it executable, ex: 'chmod +x ss' | |
# Type 'ss' at the root of a Rails app to run './script/server' | |
# You can pass arguments in the usual way | |
# Ex: 'ss -p 4000' runs './script/server -p 4000' | |
if File.executable?(Dir.getwd + '/script/server') | |
cmd = './script/server ' + ARGV.join(' ') | |
puts cmd | |
system(cmd) | |
exit | |
else | |
puts "!! Error: I don't think you're at the root of a Rails app." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment