Skip to content

Commit

Permalink
create package script add properietary lincense (#171)
Browse files Browse the repository at this point in the history
Co-authored-by: Dr. Denis <[email protected]>
  • Loading branch information
mamueluth and destogl authored Feb 19, 2024
1 parent 3cd4967 commit 71ac3e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/create-new-package.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions templates/licenses/proprietary_company_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) $YEAR$, $NAME_ON_LICENSE$

0 comments on commit 71ac3e7

Please sign in to comment.