intelligent thin start with port alias for bash
- by seaofclouds
i would like a single alias (ts) which starts my local development server. the script should test for an open port starting at 3000 and use the first available port. additionally, some sites require a rackup file, making -R config.ru necessary. this script should check the current directory for the config.ru file and add that to the alias if present.
currently, to start my local development environment, i run:
alias ts="thin -R config.ru -p 3000 start"
often, i need to run several servers to test different sites, so i've created additional aliases:
alias ts1="thin -R config.ru -p 3001 start"