Skip to content

_🛠️ Refactor suggestion_ Return a success indicator on paste command #291

@developerEhsan

Description

@developerEhsan

🛠️ Refactor suggestion

Return a success indicator

simulatePasteCommand() never tells callers if the operation actually succeeded.
Return a Promise<boolean> that resolves when the spawned process exits; propagate non-zero codes.

🤖 Prompt for AI Agents
In src/main/utils/simulate-paste-command.ts around lines 36 to 50, the
simulatePasteCommand function currently does not return any indication of
success or failure to its callers. Modify the function to return a
Promise<boolean> that resolves to true if the spawned process exits with code 0,
and resolves to false or rejects if the exit code is non-zero or an error
occurs. Wrap the spawn and event handling logic inside this Promise to properly
propagate the success status.

Originally posted by @coderabbitai[bot] in #290 (comment)

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions