You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because when MODE is unset the old approach lead the sh parser to trip over the test-syntax becoming [ = "development"] rather then [ "" = "development" ]
The more natural / elegant / simple / common strategy to this problem however is to simply use:
if [ "${MODE}"=="development" ];then
This has the added benefit of even supporting MODE values that have spaces in them. Cause in the current setup one would still have the sh parser trip over a use case like
export MODE="my mode"
/start.sh
./start-rpio.sh: line 4: [: too many arguments
simply because the test-syntax ends up as [ my mode = "development" ] rather then the hoped for [ "my mode" = "development" ]
I understand having MODE values with spaces is pushing beyond normal expectations, but as said, the suggested fix is also the more readable and common way of doing things.
The text was updated successfully, but these errors were encountered:
fixesmu-semtech#22
As mentioned there in the current setup one would still have the sh parser trip over a use case like
```
export MODE="my mode"
./start.sh: line 4: [: too many arguments
```
nvdk
linked a pull request
Nov 18, 2024
that will
close
this issue
This fix --> bb0afbf
introduced this line
mu-python-template/start.sh
Line 3 in 2ea41ed
most likely to prevent the warning
because when
MODE
is unset the old approach lead the sh parser to trip over the test-syntax becoming[ = "development"]
rather then[ "" = "development" ]
The more natural / elegant / simple / common strategy to this problem however is to simply use:
This has the added benefit of even supporting MODE values that have spaces in them. Cause in the current setup one would still have the sh parser trip over a use case like
simply because the test-syntax ends up as
[ my mode = "development" ]
rather then the hoped for[ "my mode" = "development" ]
I understand having MODE values with spaces is pushing beyond normal expectations, but as said, the suggested fix is also the more readable and common way of doing things.
The text was updated successfully, but these errors were encountered: