Skip to content

Conversation

@jeff-hykin
Copy link
Contributor

As far as I can tell, this was all that is needed for negation. e.g. ! false || echo negation works

src/shell.ts Outdated
return Promise.resolve(output).then((result)=>{
result.code = result.code == 0 ? 1 : 0
return result
})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks about right: https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/execute.rs#L335-L341

I think we should only change the code when "kind" !== "exit" though and probably we should return a new object instead of mutating just in case:

return {
  ...result,
  code: result.code === 0 ? 1 : 0,
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright change implemented 👍

@jeff-hykin
Copy link
Contributor Author

Friendly bump

@dsherret dsherret changed the title Implement negation feat: implement negation Nov 6, 2025
Copy link
Owner

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dsherret dsherret merged commit c5b59a2 into dsherret:main Nov 9, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants