#update #year #gpl #license #terminal

app year_update

Used to update the date of license files in GPL-v3 projects

1 stable release

1.2.1 Jun 23, 2024
1.2.0 Feb 25, 2024
1.1.1 Jan 29, 2024
1.1.0 Jan 11, 2024
1.0.0 Jan 8, 2024

#547 in Development tools

Download history 39/week @ 2024-07-30 2/week @ 2024-09-10 12/week @ 2024-09-24 7/week @ 2024-10-01

262 downloads per month

GPL-3.0 license

15KB
96 lines

Year Update

#!/bin/bash

dir=$1
old_year=$2
new_year=$3

if [[ $# -ne 3 || ! -d $dir ]]; then
  echo "Usage: <dir> <old_year> <new_year>"
  exit 1
fi

files=$(find "$dir" -type f -name "*.rs")

for file in $files; do
  if [[ -f $file ]]; then
    sed -i "1,5s/$old_year/$new_year/g" "$file"
  fi
done

echo "Successful replace"
chmod +x year_update.sh
sudo mv year_update.sh /usr/local/bin/year_update

Usage

Usage: <dir> <old_year> <new_year>

No runtime deps