Last active
October 19, 2015 21:09
-
-
Save abdel/b3b9d3cf32ecdba92a5c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
if [ $(git rev-parse --is-bare-repository) = true ] | |
then | |
REPOSITORY=$(basename "$PWD") | |
USERNAME=$(basename $(readlink -nf "$PWD"/..)) | |
else | |
REPOSITORY=$(basename $(readlink -nf "$PWD"/..)) | |
USERNAME=$(basename $(readlink -nf "$PWD"/../..)) | |
fi | |
PROJECT=${REPOSITORY%.git} | |
PROJECT_DIR=/var/www/$PROJECT | |
if [ ! -d "$PROJECT_DIR" ]; | |
then | |
echo "Creating $PROJECT_DIR..." | |
mkdir $PROJECT_DIR | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment