Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@e0da
Created April 17, 2015 18:32
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 e0da/2b61e8b1fb280304b7f0 to your computer and use it in GitHub Desktop.
Save e0da/2b61e8b1fb280304b7f0 to your computer and use it in GitHub Desktop.
#!/bin/sh
readonly empty_dir=$(mktemp -d)
readonly target="$1"
rm -rf "$empty_dir"
mkdir "$empty_dir"
rsync --recursive --delete "$empty_dir"/ "$target"/
rmdir "$empty_dir" "$target"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment