MatthewCroughan / octobalena

Control your 3d-printer with octoprint + octoscreen via balena!
GNU General Public License v2.0
49 stars 22 forks source link

PRINTER_NAME variable doesn't work #2

Closed MatthewCroughan closed 4 years ago

MatthewCroughan commented 4 years ago

For some reason specifying PRINTER_NAME causes jq to fill in null on entry.

MatthewCroughan commented 4 years ago

The issue was two fold. I had mistakenly used -z in the bash logic rather than -n which is the opposite logic that I intended. I always get this wrong as I remember "-n" as meaning "not" which is not the case!

From man bash section CONDITIONAL EXPRESSIONS Run this command if you wish to see it man --pager='less -p ^CONDITIONAL\ EXPRESSIONS' bash

       -z string
              True if the length of string is zero.
       string
       -n string
              True if the length of string is non-zero.