From 0801957203d35b81a174a4d4c0b035aeff66b37e Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 14 Oct 2021 18:03:19 +0200 Subject: [PATCH] updating license script --- updateAPIVersion.sh | 2 +- updateLicenseNotice.sh | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/updateAPIVersion.sh b/updateAPIVersion.sh index 39b162a8d..b89618f0e 100755 --- a/updateAPIVersion.sh +++ b/updateAPIVersion.sh @@ -1,7 +1,7 @@ #require 2 arguments, API_NAME API_DIR (relative to package) if [ $# -lt 2 ]; then echo "Wrong usage of updateVersion.sh. Requires atleast 2 arguments [API_NAME, API_DIR]" - exit -1 + return -1 fi API_NAME=$1 diff --git a/updateLicenseNotice.sh b/updateLicenseNotice.sh index f1b59ec25..7b63392f9 100644 --- a/updateLicenseNotice.sh +++ b/updateLicenseNotice.sh @@ -1,5 +1,23 @@ #!/bin/bash -for file in $(find . -name "*.h"); do +WD=$PWD +LICENCE_NOTICE_FILE=$WD/notice_to_add_for_every_file + + +if [ $# -lt 1 ]; then + echo "Wrong usage of updateLicenseNotice.sh. Requires atleast 1 argument [RELATIVE PATH]" + return -1 +fi + +CURRENT=$WD/$1 + +if [ ! -d "$CURRENT" ]; then + echo "This directory ${CURRENT} does not exist" + return -1 +fi + +cd CURRENT + +for file in $(find $CURRENT -name "*.h"); do echo Processing $file cat notice_to_add_for_every_file $file > $file.modified @@ -7,3 +25,5 @@ for file in $(find . -name "*.h"); do mv $file.modified $file done + +cd $WD