year_update

Crates.ioyear_update
lib.rsyear_update
version1.2.1
sourcesrc
created_at2024-01-08 13:35:16.379542
updated_at2024-06-23 19:48:57.257668
descriptionUsed to update the date of license files in GPL-v3 projects
homepage
repositoryhttps://gitlab.com/mateolafalce/year_update
max_upload_size
id1092540
size44,475
Mateo Lafalce (mateolafalce)

documentation

README

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>
Commit count: 7

cargo fmt