Last active
December 16, 2015 02:59
-
-
Save mackuba/5366402 to your computer and use it in GitHub Desktop.
Creates copies of all example config files in the project and shows them to you in the editor for tweaking/confirmation.
This file contains hidden or 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
#!/bin/bash | |
for FILE in $(find config -name '*.sample' -or -name '*.example'); do | |
COPY=$(echo "$FILE" | sed -E -e 's/\.[^.]+$//') | |
if [ ! -e "$COPY" ]; then | |
cp "$FILE" "$COPY" | |
echo "Created $COPY" | |
if [ "$EDITOR" ]; then | |
$EDITOR "$COPY" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment