Skip to content

Commit

Permalink
scripts: stupido script per l'aggiornamento dell'anno del copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Gelma committed Jan 5, 2012
1 parent cd90581 commit 9ca855f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions script/incrementa_anno_copyright.sh
@@ -0,0 +1,16 @@
#! /bin/bash
# Script stupido per aggiornare l'anno del copyright
# Gli anni vanno aggiornati manualmente...

# controllo di essere nel posto giusto
git remote -v | /bin/grep 'git@github.com:Gelma/LugMap.git (fetch)' -q || exit

dir_backup_prima_di_aggiornamento=/tmp/lugmap_bk
branch_attuale=$(git branch | /bin/grep '^*' | /usr/bin/cut -f2 -d ' ')
repo_locale=$(git rev-parse --show-cdup)

/bin/rm -rf "$dir_backup_prima_di_aggiornamento" # facciamo un backup iniziale per evitare di perdere modifiche non committate
[ "$repo_locale" = "" ] && repo_locale="." # sono nella root del repo
/bin/cp -af "$repo_locale" "$dir_backup_prima_di_aggiornamento"

/usr/bin/find -type f | /bin/egrep '(.py|.html|.txt|.sh|.php)$' | /usr/bin/xargs /bin/grep -il 'Copyright 2010-2012' | /usr/bin/xargs /bin/sed -i 's/Copyright 2010-2012/Copyright 2010-2012/g'

0 comments on commit 9ca855f

Please sign in to comment.