cloudflare / cloudflare/binary-install

Add option to remove only binary or whole directory

Offen
#4 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement status - PR Welcome
Vorherrschende Sprache
JavaScript
Sterne
48
Forks
23
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.