DhanushNehru / DhanushNehru/lockcheck

Add a --reset-baseline flag

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
JavaScript
Stars
11
Forks
3
Avg merge
43m
Merged PRs (30d)
1

Description

Currently, `lockcheck` saves the initial scan of dependencies to a `.lockcheck-snapshot.json` file to use as a baseline for future diffs. If developers want to reset this baseline (say, after a massive version upgrade), they have to manually delete the file using `rm .lockcheck-snapshot.json`.

We should add a quick CLI flag to do this automatically.

**Acceptance Criteria:**
-
- Add `--reset-baseline` as an allowed argument in `bin/lockcheck.js`.
- If the flag is passed, check if `resolve(dir, '.lockcheck-snapshot.json')` exists using `fs.existsSync`.
- If it exists, delete it using `fs.unlinkSync()`.
- Print a beautiful green success message `Baseline snapshot deleted. The next run will create a new baseline.` and immediately `process.exit(0)`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.