From 71ac3e773be342a1e782b70c43d7a5114b5eca5f Mon Sep 17 00:00:00 2001 From: Manuel Muth Date: Mon, 19 Feb 2024 15:50:00 +0100 Subject: [PATCH] create package script add properietary lincense (#171) Co-authored-by: Dr. Denis --- scripts/create-new-package.bash | 13 +++++++++++-- templates/licenses/proprietary_company_header.txt | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 templates/licenses/proprietary_company_header.txt diff --git a/scripts/create-new-package.bash b/scripts/create-new-package.bash index d19563ce..16445c6d 100755 --- a/scripts/create-new-package.bash +++ b/scripts/create-new-package.bash @@ -146,14 +146,16 @@ echo -e "${TERMINAL_COLOR_USER_NOTICE}The name '$MAINTAINER_NAME' and email addr # License options for a multiple choice license_user_input_option="user input" -licence_team_option="Current team license standard: ['$TEAM_LICENSE']" +licence_team_option="Current team license standard: '${TEAM_LICENSE}'" +licence_proprietary="Proprietary License - Stogl Robotics" + if [[ $ros_version == 1 ]]; then supported_licenses="" elif [[ $ros_version == 2 ]]; then supported_licenses=$(ros2 pkg create dummy --license "?") supported_licenses=${supported_licenses#"Supported licenses:"} fi -license_options=("$license_user_input_option" "$licence_team_option") +license_options=("$license_user_input_option" "$licence_team_option" "$licence_proprietary") license_options+=($supported_licenses) echo "" @@ -169,6 +171,13 @@ do LICENSE="$TEAM_LICENSE" break ;; + "$licence_proprietary") + read -p "Enter name of license (e.g. 'Propriatery License'): " NAME_OF_LICENSE + YEAR=$(date +'%Y') + LICENSE=$(<"${LICENSE_TEMPLATES}/proprietary_company_header.txt") + LICENSE=$(echo "${LICENSE}" | sed -e "s/\\\$YEAR\\\$/${YEAR}/g; s/\\\$NAME_ON_LICENSE\\\$/${NAME_OF_LICENSE}/g") + break + ;; *) LICENSE="$licence_option" break diff --git a/templates/licenses/proprietary_company_header.txt b/templates/licenses/proprietary_company_header.txt new file mode 100644 index 00000000..b5af46c8 --- /dev/null +++ b/templates/licenses/proprietary_company_header.txt @@ -0,0 +1 @@ +Copyright (c) $YEAR$, $NAME_ON_LICENSE$