Last active
December 28, 2015 14:29
A Bash script to make easier the symlinking one must do to get started using an app with Pow.
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
#! /bin/bash | |
# Download Pow now at http://pow.cx/ | |
if [ \( "$2" != "-f" \) -a \( $# != 1 \) ] | |
then | |
echo "Usage: pow <appname> [-f]" | |
echo "<appname>.dev will be the development url." | |
exit 1 | |
else | |
_dir="$(pwd)" | |
cd ~/.pow | |
if (( $# == 1 )) | |
then | |
if [ -h $1 ] | |
then | |
cd $_dir | |
echo "Server already exists. Use -f to overwrite." | |
exit 1 | |
fi | |
elif [ \( "$2" == "-f" \) ] | |
then | |
rm -rf $1 | |
fi | |
ln -s $_dir $1 | |
cd $_dir | |
echo "Server successfully initiated at $1.dev" | |
open "http://$1.dev" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment