Skip to content

Instantly share code, notes, and snippets.

@foxleigh81
Last active December 13, 2018 20:20
Show Gist options
  • Save foxleigh81/b27d443bf53b582936c829b71b9c2ead to your computer and use it in GitHub Desktop.
Save foxleigh81/b27d443bf53b582936c829b71b9c2ead to your computer and use it in GitHub Desktop.
unwrap bash alias
# Copies the contents of the current directory into the parent
# directory and then deletes the current directory
unwrap() {
THISDIR=`basename $PWD`
if [ -z "$(ls -A)" ]; then
echo "No files to unwrap."
else
cp -r * ../
fi
echo "Removing directory"
cd ..
rm -rf $THISDIR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment