Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
executable file 21 lines (18 sloc) 377 Bytes
#!/usr/bin/env bash
# collapse.sh
# collapses the given directory into its parent directory
# Author: William Woodruff
# Licensed under the MIT License: http://opensource.org/licenses/MIT
function usage()
{
printf "Usage: $0 <directory>\n"
}
if [ ! -d "$1" ] ; then
printf "Error: no such directory\n"
usage
exit 1
else
cp -r "$1/." "$1/../"
rm -r "$1"
exit 0
fi
You can’t perform that action at this time.