Skip to content

Instantly share code, notes, and snippets.

@mackuba
Last active December 16, 2015 02:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackuba/5366402 to your computer and use it in GitHub Desktop.
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.
#!/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