Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Commit

Permalink
Remove the working dir, if it exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
dashohoxha committed Sep 29, 2015
1 parent a7eaa67 commit 35862d8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docker/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@ then
docker create --name=$container --hostname=$hostname \
-p 80:80 -p 443:443 -p $ssh:$ssh $image
else
### remove the directory labdoo/ if it exists
if test -d labdoo/
then
cd labdoo/
if test -n "$(git status --porcelain)"
then
echo "Directory labdoo/ cannot be removed because it has uncommited changes."
exit 1
fi
cd ..
rm -rf labdoo/
fi

### create a container for development
docker create --name=$container $image
docker start $container
rm -rf labdoo/
docker cp $container:/var/www/lbd/profiles/labdoo $(pwd)/
docker stop $container
docker rm $container
Expand Down

0 comments on commit 35862d8

Please sign in to comment.