Created
September 8, 2014 14:01
-
-
Save agile/ae871e73eef695609fbb to your computer and use it in GitHub Desktop.
Stupid script to rename stupid screenshots for a stupid issue tracker
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
#!/bin/bash | |
# | |
# Rename screenshots into a format Jira won't complain about.. ;P | |
# | |
SCREENSHOTDIR=~/ | |
LOCKFILE=$(dirname $0)/$(basename $0).pid | |
echo "LOCKFILE: ${LOCKFILE}" | |
if [ -e ${LOCKFILE} ]; then | |
if ps --no-header $(cat ${LOCKFILE}) >/dev/null 2>&1; then | |
exit 1 | |
fi | |
fi | |
echo $$ > ${LOCKFILE} | |
watch() | |
{ | |
while true; do | |
inotifywait -e CREATE ${SCREENSHOTDIR} && rename 's/[ :]/\_/g' ${SCREENSHOTDIR}/Screenshot*.png; | |
done | |
} | |
watch& | |
echo $! > ${LOCKFILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment