From d9fd1af2729c1cb5fa2ac07b6c99bdbb5fb4da3e Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Tue, 11 Apr 2017 17:36:09 -0700 Subject: [PATCH] contributions: Updated assignments in template Fixed bug in sensortemplate script. Handled assinment operator with export since exec'ed processes need these variables. Signed-off-by: Noel Eck --- docs/contributions.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/contributions.md b/docs/contributions.md index ce049c6f..1a2ff8f1 100644 --- a/docs/contributions.md +++ b/docs/contributions.md @@ -108,13 +108,14 @@ commands below to generate collateral files for your new sensor library. #!/bin/bash function make_new_sensor { - SensorName=$1 + export SensorName=$1 + # Get a lowercase version of the string + export sensorname=${SensorName,,} + # Make sure this is run from the root UPM directory if ! grep -q 'UPM ' README.md; then echo "Please run from the root UPM directory"; return -1; fi - # Copy/paste the below commands into a bash shell... - # Get a lowercase version of the string - sensorname=${SensorName,,} + printf "Generating new sensor: ${SensorName}\n" # Copy sensortemplate files to ${sensorname} find docs/ examples/ src/ -name '*sensortemplate*' -exec bash -c 'cp -r $0 ${0/sensortemplate/${sensorname}}' {} \; # Copy SensorTemplate files to ${SensorName}