-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional pubber opts #338
Conversation
bin/pubber
Outdated
@@ -2,8 +2,8 @@ | |||
|
|||
ROOT_DIR=$(realpath $(dirname $0)/..) | |||
|
|||
if [ $# != 4 ]; then | |||
echo $0 SITE_PATH PROJECT_ID DEVICE_ID SERIAL_NO | |||
if [[ "${#}" -lt "4" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? $# is a lot easier to read! (Also, quotes are unnecessary with [[, since it's an explicit different parser to avoid the extra clutter!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use ((
instead as per style guide
bin/pubber
Outdated
@@ -23,4 +23,35 @@ $ROOT_DIR/pubber/bin/build > /dev/null | |||
|
|||
echo Running tools version `(cd $ROOT_DIR; git describe)` | |||
|
|||
$ROOT_DIR/pubber/bin/run $project_id $site_path $device_id $serial_no | |||
if [[ "${#}" -gt "0" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would flip the if condition so the short branch is first, rather than after the else (just makes it easier to read)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition flipped
bin/pubber
Outdated
fi | ||
done | ||
|
||
extra_field="${options[extra_field]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this used? I would expect somewhere in this PR to see how the added functionality is used...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraField
is an existing pubber config, extra_field
provides access to it. I'll update the documentation to describe the additional functionality
bin/pubber
Outdated
|
||
cloud_region=`jq -r .cloud_region $site_path/cloud_iot_config.json` | ||
|
||
cat <<EOF > /tmp/pubber_config.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent seems too much?
@grafnu I had to make a change because if extraField is in the pubber config then it's included by pubber, so I made a change to only include extraField if it's set. |
extra_field
andextra_point
, e.g.bin/pubber sites/udmi_site_model project_id AHU-1 123 extra_point=blahblah
bin/pubber sites/udmi_site_model project_id AHU-1 123 extra_point extra_field