Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts: stupido script per l'aggiornamento dell'anno del copyright
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |