File: fixyear.sh

package info (click to toggle)
ponyprog 3.1.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,904 kB
  • sloc: cpp: 35,932; python: 981; sh: 565; xml: 67; makefile: 45; ansic: 38
file content (22 lines) | stat: -rwxr-xr-x 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -o errexit

OLD_YEAR=2022
CURRENT_YEAR=`date +%Y`

FILESC=`find -name "*.cpp" -type f`
FILESH=`find -name "*.h" -type f`
FILES="${FILESC} ${FILESH} ponyprog.pro CMakeLists.txt distribution/innosetup/ponyprog.iss"

for i in ${FILES}
do
  if [ -f "${i}" ]; then
    echo "Converting ${i}"
    sed -i "s@1997-${OLD_YEAR}@1997-${CURRENT_YEAR}@g" "${i}"
  else
    echo "File non esiste: ${i}"
  fi
done

exit 0