Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to remove only binary or whole directory #4

Open
EverlastingBugstopper opened this issue Mar 2, 2020 · 0 comments
Open
Labels
enhancement New feature or request status - PR Welcome This issue is well-defined and community PRs are welcome

Comments

@EverlastingBugstopper
Copy link
Contributor

EverlastingBugstopper commented Mar 2, 2020

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())

@EverlastingBugstopper EverlastingBugstopper added enhancement New feature or request status - PR Welcome This issue is well-defined and community PRs are welcome labels Mar 2, 2020
goto-bus-stop pushed a commit to goto-bus-stop/binary-install that referenced this issue Jan 19, 2024
…windows-exe

fix: updates example to work on windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status - PR Welcome This issue is well-defined and community PRs are welcome
Projects
None yet
Development

No branches or pull requests

1 participant