Last active
December 13, 2018 20:20
-
-
Save foxleigh81/b27d443bf53b582936c829b71b9c2ead to your computer and use it in GitHub Desktop.
unwrap bash alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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