Skip to content

Instantly share code, notes, and snippets.

@joahg
Last active December 28, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joahg/7514748 to your computer and use it in GitHub Desktop.
Save joahg/7514748 to your computer and use it in GitHub Desktop.
A Bash script to make easier the symlinking one must do to get started using an app with Pow.
#! /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