Thanks for the pointers, will use || true. And yes, I don't care about the 
exit status, just want to get the variable assigned or not.

It is shell (trying to move gmake's shell directive).

-Amarendra

--
sent via recycled electrons from mobile command center.

> On Aug 14, 2025, at 6:34 PM, Chris Ross <cross+open...@distal.com> wrote:
> 
> If you truely don’t care about the exit status and just want to ignore it, 
> you can use “|| true” which is more clear than “echo -n” IMO.   You shouldn’t 
> need the subshell (parens).  Unless that’s a syntax requirement of whatever 
> you’re doing this in.  (Is this shell?  make ?  You didn’t say.)
> 
> - Chris
> 
>> On Aug 14, 2025, at 00:55, Amarendra Godbole <amarendra.godb...@gmail.com> 
>> wrote:
>> Run into an issue where the following prints an error message:
>> GIT_TAG  != git describe --tags --abbrev=0 --exact-match 2>/dev/null
>> ...
>> *** Warning in /home/ag/src/helm: "git describe --tags --abbrev=0
>> --exact-match 2>/dev/null" returned non-zero status (Makefile:36)
>> I can address this by doing:
>> GIT_TAG  != (git describe --tags --abbrev=0 --exact-match 2>/dev/null)
>> || echo -n
>> Is there a better way to handle this?
>> Thanks.
>> -ag

Reply via email to