ditrit / OGrEE-CLI

CLI for OGrEE
Mozilla Public License 2.0
3 stars 0 forks source link

.env file not read when CLI ARGs are used #132

Closed hchybz closed 1 year ago

hchybz commented 1 year ago

when args are passedo on cmdline, env file seems not to be read correctly, throwing errors

PS C:\Users\herve\Desktop\OGrEE> type .\.env
unityURL=127.0.0.1:5500
listenPORT=5501

# WSL
_apiURL=http://172.21.250.125:3001
_user=herve@chibois.net
_apiKey=eyJhbGNWzvP3TwakyHMMPS8HJYW_Jd2GZwbVp-_DHwbB0DaA

#Native Win11
apiURL=http://127.0.0.1:3001
apiKey="eyJhbG9AY2hpYm9pcy5uZXQifQ.zNI5t9Yzi-ig72RpXR0CFsQLzHbyLRzC7LqHL2dsOE"
user="toto@chibois.net"

updates=all
drawable=all
tenantDrawableJson='./other/drawTemplates/tenant.json'
siteDrawableJson=null
buildingDrawableJson=null
roomDrawableJson=null
rackDrawableJson=null
deviceDrawableJson=null
acDrawableJson=null
powerpanelDrawableJson=null
separatorDrawableJson=null
cabinetDrawableJson=null
rowDrawableJson=null
tileDrawableJson=null
corridorDrawableJson=null
sensorDrawableJson=null
roomTemplateDrawableJson=null
objTemplateDrawableJson=null
groupDrawableJson=null
unityDeadline=5s

PS C:\Users\herve\Desktop\OGrEE> .\issue131JsonFormat.exe -api_url http://172.21.250.125:3001 -v DEBUG
Warning: Unity deadline not found in env file. Resorting to default of 10 ms
HTTP Response Status code403
Error while checking key. Now exiting

PS C:\Users\herve\Desktop\OGrEE> .\issue131JsonFormat.exe
Setting Draw Limit to default
toto@OGrEE3D:/Physical$> exit

PS C:\Users\herve\Desktop\OGrEE> .\issue131JsonFormat.exe -api_url http://172.21.250.125:3001 -v DEBUG -e .\.env
Warning: Unity deadline not found in env file. Resorting to default of 10 ms
HTTP Response Status code403
Error while checking key. Now exiting
PS C:\Users\herve\Desktop\OGrEE>
denizul commented 1 year ago

Were you able to reproduce this error? The CLI reads the env file perfectly for me

GeremWD commented 1 year ago

There is still the GetEmail function in initController.go that tries to open ./.env rather than the one specified with the flag, causing an error message when the "lsog" command is executed.

hchybz commented 1 year ago

leave me some examples + comments .