cloudflare / cloudflare/binary-install
Add option to remove only binary or whole directory
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 48
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
Currently, binary-install assumes that uninstalling should remove the entire directory from the user's machine, however some libraries may have application-specific code in that directory. If that is the case, they may want to give users the choice of whether or not they want to remove application-specific code, or just the binary.
binary-install should remove the entire directory by default, but should allow library consumers to toggle the feature where the user is prompted to either remove the entire directory or just the binary.
current code in uninstall that should remain the default
if (existsSync(this._getInstallDirectory())) {
rimraf.sync(this.installDirectory);
console.log(
`${this.name ? this.name : "Your package"} has been uninstalled`
);
}
if the user passes option.uninstallPrompt = true
"Would you like to remove all of your data associated with ${this.name}`? (y/n)
if y -> use existing default code
if n -> fs.unlink(this._getBinaryPath())
Contributor guide
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.
Research direction
Start at the uninstall entry point and inspect the existing checks around _getInstallDirectory(), installDirectory, and _getBinaryPath(). Preserve the current full-directory removal as the default, then verify that option.uninstallPrompt controls the choice and that declining removes only the binary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100