M: Script is not idempotent - #5
Open
@Rtaibzadah is already working on this.
Since Dec 18, 2025.
bug
- Dominant language
- Shell
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Description
Running challenge-m.sh multiple times currently causes the script to append duplicate content to the output file.
This makes the script unsafe to run more than once and unsuitable for automation.
The script must be made idempotent, meaning repeated executions produce the same result without duplication.
Acceptance Criteria
- Running the script multiple times produces the same output every time
- No duplicate entries are written to the output file
- Existing valid data is preserved and not corrupted
- The script behaves correctly whether the output file already exists or not
Notes
- Assume this script may be executed automatically (e.g. via cron)
- The solution should be simple and easy to reason about
- Idempotency is more important than performance
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.