msanders / cider

Hassle-free bootstrapping with Homebrew.
https://pypi.python.org/pypi/cider/
MIT License
840 stars 25 forks source link

Parse Stdout instead of straight up copying #12

Closed Miladiir closed 9 years ago

Miladiir commented 9 years ago

I noticed that cider does not really parse the output of brew, but instead copies elements into bootstrap.json.

This results in the following JSON, which, on restore, should lead to an error:

~  
❯ cat ~/.cider/bootstrap.json
{
    "casks": [
        "==> Removing legacy Tap",
        "filebot"
    ]
}
~  
❯ cider cask missing
Warning: 2 missing formulas (tip: try `brew uses --installed` to see what's using it)
==> Removing legacy Tap
filebot

Add missing items to bootstrap? [y/N] y
Success! Added ==> Removing legacy Tap to bootstrap
Success! Added filebot to bootstrap

Note that this entry comes from a special misconfiguration of my brew cask installation (I guess), but cider should really account for user errors like that. Make it a little bit smarter and sort out entries that start with special character, because brew formulas don't use them.