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

Uninstall packages not listed in packages.cson #22

Closed
wants to merge 1 commit into from
Closed

Uninstall packages not listed in packages.cson #22

wants to merge 1 commit into from

Conversation

jbhannah
Copy link
Contributor

@jbhannah jbhannah commented Apr 21, 2016

Adds a setting that, when enabled, uninstalls packages missing from packages.cson on sync. Fixes #11.

@lee-dohm
Copy link
Owner

Can you resolve the conflicts here and add some specs?

@jbhannah
Copy link
Contributor Author

Will-do. I did add a spec for the inverse case of getMissingPackages, any other in particular you're looking for?

Adds a setting that, when enabled, uninstalls packages missing from
packages.cson on sync. Fixes #11.
@dsifford
Copy link

Any status updates on this? This feature alone will convert me from sync-settings to this package.

@dsifford
Copy link

dsifford commented Jun 13, 2016

Scratch the urgency. I just dropped this little script in my ~/bin directory and it seems to do the job just fine with this package installed.

ATOM-ORPHANED

#!/usr/bin/node
const fs = require('fs');
const { HOME } = process.env;
const haystack = fs.readFileSync(`${HOME}/.dotfiles/packages.cson`, 'utf8');
const hs = haystack.match(/"(.+)"/g).map(p => p.replace(/"/g, ''));
const needle = fs.readdirSync(`${HOME}/.atom/packages`)
  .filter(p => p !== '.wlck' && haystack.indexOf(p) === -1)
  .join('\n');

console.log(needle);

After running a package-sync:sync, I just do apm rm $(ATOM-ORPHANED) and all orphans are removed 👍

My packages.cson file is symlinked using Dotbot (if you're wondering about the weird location)

@mauricerkelly
Copy link

Is there anything holding this up from being merged? I would love to see this feature included.

@czchen
Copy link
Contributor

czchen commented Jan 25, 2017

@jbhannah

Any progress for this feature? I would love to have this feature in package-sync.

@jbhannah
Copy link
Contributor Author

@czchen I haven't heard back from @lee-dohm if there are any other specs that he would like added before this can be merged in.

@Gerschtli
Copy link

@lee-dohm @jbhannah is there any chance, this PR gets merged?

@Gerschtli
Copy link

For the ones interested in a maintained alternative, have a look at https://atom.io/packages/manage-packages

@jbhannah jbhannah closed this by deleting the head repository Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uninstall packages not listed in packages.cson
6 participants