Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
replacejs() {
FOLDER_NAME=$(basename $1 | sed 's/\.js\(x\)\{0,1\}$//')
FOLDER=$(dirname $1)/$FOLDER_NAME
SUFFIX=$(basename $1 | sed 's/.*\.//')
mkdir $FOLDER
mv $1 $FOLDER/index.$SUFFIX
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment