#!/bin/bash cd $(dirname $0) cd .. tempDir=$(mktemp -d) find . -name "*" -and -not -name "." -and -not -path "./src/*" -and -not -path "./src" -exec rm -rf {} + rsync -a --delete ./src/ $tempDir rsync -a --delete $tempDir/ . rm -rf $tempDir