From 298fd2f0d2eec96af2ce92b9ea482ad7c4c98690 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Sat, 15 Jan 2022 19:48:47 -0500 Subject: [PATCH] feat: license updater --- resources/license_updater.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 resources/license_updater.sh diff --git a/resources/license_updater.sh b/resources/license_updater.sh new file mode 100644 index 0000000..4ed1069 --- /dev/null +++ b/resources/license_updater.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# update the years in the licenses + +old_year="2021" +new_year="2022" +replace_str="s/${old_year}/${new_year}/g" + +echo -e "\t---- Updating licenses ----\n" + +for file in *; do + [[ -d ${file} ]] && { + [[ -f ${file}/LICENSE ]] && { + echo -e " + Updating \e[0;32m${file}/LICENSE\e[0m..." + grep -rl 2021 "${file}/LICENSE" | xargs sed -i ${replace_str} + } + } +done