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 <noel.eck@intel.com>
This commit is contained in:
Noel Eck 2017-04-11 17:36:09 -07:00
parent 78eb975435
commit d9fd1af272

View File

@ -108,13 +108,14 @@ commands below to generate collateral files for your new sensor library.
#!/bin/bash #!/bin/bash
function make_new_sensor { 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 # 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 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... printf "Generating new sensor: ${SensorName}\n"
# Get a lowercase version of the string
sensorname=${SensorName,,}
# Copy sensortemplate files to ${sensorname} # Copy sensortemplate files to ${sensorname}
find docs/ examples/ src/ -name '*sensortemplate*' -exec bash -c 'cp -r $0 ${0/sensortemplate/${sensorname}}' {} \; find docs/ examples/ src/ -name '*sensortemplate*' -exec bash -c 'cp -r $0 ${0/sensortemplate/${sensorname}}' {} \;
# Copy SensorTemplate files to ${SensorName} # Copy SensorTemplate files to ${SensorName}