Git Product home page Git Product logo

homebrew-bundle's Introduction

Homebrew (Legacy)

This repository was deprecated and split into two repositories:

homebrew-bundle's People

Contributors

andrew avatar aramprice avatar bo98 avatar brewtestbot avatar colindean avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ericfromcanada avatar issyl0 avatar jacobbednarz avatar jamesaanderson avatar jeremy avatar joehorsnell avatar jrochkind avatar mikemcquaid avatar mistydemeo avatar parkr avatar pvdb avatar quad avatar quentin-fox avatar reitermarkus avatar rprimus avatar rylan12 avatar sjackman avatar teoljungberg avatar tyrubias avatar vraravam avatar wendorf avatar xu-cheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebrew-bundle's Issues

Fix English

Thanks for working on this!

The output for the main command seems a little off in terms of idiomatic English.

Succeed to install <thing>

Should be something like:

Successfully installed <thing>
Failed to install <thing>
Tapped <thing>

I will try and sort this if I have a spare moment - the relevant line is https://github.com/Homebrew/homebrew-brewdler/blob/7d9be9deb2601247136e0ce2b526ae0c1e7a7ada/lib/brewdler/dsl.rb#L41-L47

For the future it might be nice to have these strings generally translated.

Error: undefined method `[]' for nil:NilClass

I'm sorry, my English is not good.
An error has occurred.
Can anyone help me?

mac OS X El Capitan

> brew -v
Homebrew 0.9.5 (git revision 11160; last commit 2015-11-08)
> brew bundle --version
1.1.1
> brew bundle install
Succeeded in tapping homebrew/bundle
Error: undefined method `[]' for nil:NilClass
Please report this bug:
    https://github.com/Homebrew/homebrew-bundle/issues/
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:77:in `formula_inspector'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:64:in `block in formulae_info'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:64:in `map'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:64:in `formulae_info'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:14:in `formulae'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:38:in `formula_names'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_installer.rb:58:in `installed_formulae'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_installer.rb:50:in `formula_installed?'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_installer.rb:74:in `installed?'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_installer.rb:26:in `install_or_upgrade'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_installer.rb:10:in `install'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/dsl.rb:56:in `block in install'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/dsl.rb:40:in `each'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/dsl.rb:40:in `install'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/commands/install.rb:4:in `run'
/usr/local/Library/Taps/homebrew/homebrew-bundle/cmd/brew-bundle:71:in `<main>'

Brewfile

tap 'homebrew/bundle'

brew 'ack'
brew 'autoconf'
brew 'checkbashisms'
brew 'coreutils'
brew 'cowsay'
brew 'direnv'
brew 'ffmpeg'
brew 'figlet'
brew 'fzf'
brew 'gawk'
brew 'gdbm'
brew 'gifsicle'
brew 'git'
brew 'go', args: ['cross-compile-common']
brew 'hub'
brew 'hugo'
brew 'jq'
brew 'lame'
brew 'libevent'
brew 'mercurial'
brew 'nkf'
brew 'node.js'
brew 'nodebrew'
brew 'openssl'
brew 'peco'
brew 'python'
brew 'rbenv'
brew 'readline'
brew 'reattach-to-user-namespace'
brew 'ruby-build'
brew 'shellcheck'
brew 'sqlite'
brew 'terminal-notifier'
brew 'tig', args: ['with-docs']
brew 'tmux'
brew 'tree'
brew 'vim', args: ['with-lua', 'with-luajit']
brew 'wget'
brew 'zsh', args: ['disable-etcdir']
brew 'zsh-completions'

tap 'caskroom/cask'
brew 'brew-cask'
cask '1password'
cask 'appcleaner'
cask 'bettertouchtool'
cask 'burn'
cask 'clipmenu'
cask 'dragondrop'
#cask 'dropbox'
cask 'firefox'
cask 'flashlight'
cask 'google-japanese-ime'
cask 'karabiner'
cask 'karabiner'
cask 'keycast'
cask 'kobito'
cask 'macdown'
cask 'mactex'
cask 'macvim'
cask 'mailbox'
cask 'messenger'
cask 'skitch'
cask 'skype'
cask 'the-unarchiver'
cask 'vagrant'
cask 'virtualbox'
cask 'vlc'

# vim: ft=conf

Feature Request: dump existing install into Brewfile

Since this becomes homebrew official method to bundle homebrew install. I hope we can add more feature to it. Shall we?

So instead of reading Brewfile and install them, I hope to do the reverse that is writing current installation to a Brewfile. I have wrote some similar tool before. And if it's OK, I can work on a PR.

brewdle vs bundle

Should the README be corrected to say "brewdle" instead of "bundle"?

For example brew bundle dump will give the deprecation warning but brew brewdle dump works like a charm.

Dump full tap paths

If I've installed a formula as brew install homebrew/versions/gcc48 then it should be dumped the same way in the Brewfile e.g. brew 'homebrew/versions/gcc48 rather than the current version which is just gcc48. Additionally we could use this to simplify only dumping taps that don't belong to one of these formulae (if necessary).

Adding this so I remember to do it at some stage but if anyone wants to beat me to it: feel free!

Generate less output when not actually installing anything

I'm looking to add a Brewfile to a project, and run brew bundle when bootstrapping it.

If I have a pretty simple Brewfile like:

brew 'nagios'

And I run brew bundle multiple times, I always get this output, even when nagios is already installed:

$ brew bundle
Succeeded in installing nagios

Success: 1 Fail: 0

I could imagine there being a flag like --quiet which only outputs if something was actually installed. Or, maybe having a --check option which is used for scripting, so you can do something like this: https://github.com/github/scripts-to-rule-them-all/blob/master/script/bootstrap#L10-L13

Release installation options

Functionality for installing with options was added in #17, but they have not been released in a new version of this gem. Is this scheduled to occur?

`brew bundle check` gives opaque error message when using an alias

Running brew bundle check with brew 'zmq' in my Brewfile results in:

brew bundle can't satisfy your Brewfile's dependencies.
Install missing dependencies with `brew bundle install`.

Running brew bundle install succeeds with no errors, but the error message still shows when running check. Replacing 'zmq' with 'zeromq' in the Brewfile fixes the problem.

Took me a few minutes to figure out what the problem was, so if supporting aliases isn't an easy fix, I'd suggest a more specific error message when one is included in a Brewfile.

Dump should handle dependencies order.

brew bundle dump should handle entry order based on dependencies. The dependencies of a formula should come first. At the same time, requirements from cask like java, mactex should come first as well. But some casks should come later for those depend on formula.

Awesome! Any plans for other *nix compatibility?

We had plans for a project a little like this but the idea was to make it cross platform so if you develop on Mac and deploy to Linux, dependencies would install and resolve properly in both places... currently of course Homebrew is Mac only, but I saw someone has an experimental Solaris port of homebrew (https://github.com/rmyers/homebrew)... Curious if this is a personal itch you'd like to scratch as well, and if so, I know some people (myself included) who'd like to help if we can!

Feature Request: improve security

Brewfile is much like a Gemfile. However, the brewdler implementation is a lot of simpler. Currently, we use the evil eval to parse Brewfile and string concatenation to generate system command. So there will be a lot of security vulnerabilities. Hence, the question is can we improve it like what gem did?

I'm not a security expert. But I think we can do better.

install with options

I want to brew install with options.
For example, brew install --cocoa emacs.

Brewfile from STDIN

It would be helpful to pipe the Brewfile into brew bundle. This can allow for small modular Brewfiles without littering the filesystem.

Works great with linuxbrew

I'm sorry if this isn't the right place but I couldn't find a better place to post this: I started using homebrew-bundle with linuxbrew (Ubuntu 15.10) and it works great! I thought I should let you know because of the incertain wording in the readme (should work).

Add DSL for handling services

When nginx is installed it has a launchd plist that it includes. This isn't (yet) copied or started but it'd be nice if it could be.

Perhaps it'd be nice to have an API like:

brew 'nginx', restart_service: 'true'

that will run tap https://github.com/Homebrew/homebrew-services and then run brew services restart nginx to setup and start nginx.

Look nicer on 80 character wide terminals

e.g. currently:

$ brew brewdle --help
brew brewdle dump [--force]
brew brewdle cleanup [--dry-run]
brew brewdle [--version]
brew brewdle [-h|--help]

Usage:
Bundler for non-Ruby dependencies from Homebrew

brew brewdle                    read Brewfile and install all dependencies
brew brewdle dump               write all currently installed packages into a B
ewfile
brew brewdle cleanup            uninstall all Homebrew formulae not listed in B
ewfile

Options:
--force                        force overwrite existed Brewfile
--dry-run                      list formulae rather than actual uninstalling th
m
-h, --help                     show this help message and exit
--version                      show the version of brewdler

Feature Request: Upgrade Packages

It would be nice to have the ability to upgrade packages. This could either be automatically (if an upgrade exists for a package in the Brewfile, then upgrade it) or a separate dsl so its a tad more explicit (such as 'brew_upgrade').

This is inspired by thoughtbot's laptop setup script: https://github.com/thoughtbot/laptop/blob/master/mac#L56

brew_install_or_upgrade() {
  if brew_is_installed "$1"; then
    if brew_is_upgradable "$1"; then
      fancy_echo "Upgrading %s ..." "$1"
      brew upgrade "$@"
    else
      fancy_echo "Already using the latest version of %s. Skipping ..." "$1"
    fi
  else
    fancy_echo "Installing %s ..." "$1"
    brew install "$@"
  fi
}

I'd love to submit a PR for this feature, just interested to hear which method is more likely to be accepted.

Make `brew bundle cleanup` safer

I wonder if it makes sense to make brew bundle cleanup not do anything without either e.g. --dry-run, --global or --force. A coworker was just trying out brew bundle and managed to blow away almost all his installed formulae by mistake. I've personally never used cleanup without --global and I can see why it would be dangerous.

How can I install app with --HEAD

Hi
I would like to install rbenv-build. And the command I run is brew install --HEAD ruby-build.
How can I handle it with Brewfile?
Thanks!

Feature request: allow "gem" subcommand

I use brew-gem to manage my installed Ruby gems with homebrew, but when I put gem install somegemname on a line in a Brewfile, I get Error: Invalid Brewfile.

Can you make these two great tastes taste great together?

Missing Brewfile throws traceback

cquinn@Quinnertube% brew bundle                                                   
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/utils.rb:35:in `rescue in brewfile': No Brewfile found (RuntimeError)
    from /usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/utils.rb:28:in `brewfile'
    from /usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/commands/install.rb:4:in `run'
    from /usr/local/Library/Taps/homebrew/homebrew-bundle/cmd/brew-bundle:66:in `<main>'

Can we clean that up a bit?

brew bundle vs brew cask install: Apps on and off the App Store

Steps to reproduce:

  1. Install an app that is available both in the official App Store, and by the developer (preferably from the App Store for the purposes of this bug)
  2. Install homebrew-bundle
  3. Install homebrew-cask
  4. Create a Brewfile and list the app you chose in step 1. e.g. Skitch.

Example

$ brew cask install skitch
Warning: A Cask for skitch is already installed. Add the "--force" option to force re-install.

Brewfile
cask 'skitch'

$ brew bundle
Succeeded in installing skitch
Success: 1 Fail: 0

Link command?

To force all packages to use homebrew's version of openssl, scripts often include

brew unlink openssl && brew link openssl --force

Is there any scope for a link and unlink command in the dsl?

Return non-zero when `$ brew bundle` fails

When running brew bundle now, if a package fails to install, the command still returns 0. It would be awesome if the command returned 1 or some other non-zero value whenever it encounters an error.

For example, given the following Brewfile:

# Brewfile
brew 'node'
brew 'some-package-that-doesnt-exist'
$ brew bundle
Succeed to install node
Error: No available formula for some-package-that-doesnt-exist 
Searching formulae...
Searching taps...
Fail to install some-package-that-doesnt-exist

Success: 1 Fail: 1

$ echo $?
0

Show the caveats on the standard output

It looks like all the caveats section is not shown when using the bundle.

Some times the caveats section provides useful info. It should be visible when installing.

Add version support

Homebrew now understands versions e.g. brew versions redis , so brewdler could support specifying particular versions like so:

redis, '> 2.6.0'

brewdle cleanup handling dependencies

Currently, using Brewfile as a 'whitelist' (using cleanup) will remove any installed dependencies for installed packages. A good example is installing ffmpeg and then running brew brewdle cleanup which removes the dependencies for ffmpeg.

I feel that the cleanup functionality should ignore/skip packages that are installed as dependencies for a package existing in the Brewfile. Otherwise, cleanup can break many installations.

Migrate to a Homebrew tap command

If you put a brew-brewdler.rb or similarly named file in the cmd directory of a tap then you can call it with brew brewdler without having to add it to the PATH, install it with RubyGems or any of that jazz. It'll also be kept up-to-date automatically with brew update.

Seems to me this could be a pretty neat deployment method as it wouldn't require any installation beyond a brew tap andrew/homebrew-brewdler. The only downside is that using Bundler and Gem dependencies is trickier. Taking a brief look at the code I reckon this project could get away with no runtime Gem dependencies.

Thoughts? If you're extremely ๐Ÿ‘Ž on this I'm happy to close out. Otherwise would be great if anyone wanted to pick this up (and if they didn't, I will). I'm also happy to get this moved to the Homebrew organisation and bless it as the "official" solution.

Thanks again @andrew and others!

Add DSL for conditional installation

I might have a Brewfile with cask 'java'. Problem is, I want to be able to use this on systems which may already have Java installed from somewhere other than brew cask.

Perhaps it'd be nice to have an API like:

cask 'java', unless: "/usr/libexec/java_home --failfast"

that will only install Java if that command fails. If the cask is already installed it should still upgrade it.

Add verbose option

Hi all. I love this project!

I'm using brewdle right now to setup a new machine. And its seems to be going smoothly, but... The output is blank! The only thing I got for this Brewfile:

# Packages
brew 'zsh'
brew 'git'
brew 'rbenv'
brew 'ruby-build'
brew 'vim', args: ['override-system-vi']
brew 'node'
brew 'python'
brew 'brew-cask'
brew 'imagemagick'

# Apps
tap 'caskroom/cask'

cask 'iterm2'
cask 'google-chrome'
cask 'alfred'
# more stuff...

was

$ brew brewdle
Error: No available formula for brew-cask 
Cloning into '/usr/local/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 124686, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 124686 (delta 33), reused 2 (delta 0)
Receiving objects: 100% (124686/124686), 34.34 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (82534/82534), done.
Checking connectivity... done.
Error: Unknown command: cask
Error: Unknown command: cask
Error: Unknown command: cask
...

I was expecting some output like successfully installed 'zsh'. I think either adding redirecting brew's stdout by default, or at lest adding a verbose option, would be a nice improvement.

Skip already installed packages

So I just created a Brewfile with a bunch of casks. If I modify the Brewfile and run brew bundle again, it doesn't appear to skip the casks that have already been installed. It's sitting there on each line for a while with "curl" up in the Terminal header.

Running brew bundle - failure

Hello all,

On a completely fresh OSX Mountain Lion install. Homebrew is installed, brew tap homebrew/bundle completed correctly. Running: brew bundle results in the following:

Error: /usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:72: odd number list for Hash
        name: f["name"],
             ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:72: syntax error, unexpected ':', expecting '}'
        name: f["name"],
             ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:73: syntax error, unexpected ':', expecting '='
        full_name: f["full_name"],
                  ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:74: syntax error, unexpected ':', expecting '='
        args: args,
             ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:75: syntax error, unexpected ':', expecting '='
        version: keg["version"],
                ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:76: syntax error, unexpected ':', expecting '='
        dependencies: f["dependencies"],
                     ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:77: syntax error, unexpected ':', expecting '='
        requirements: f["requirements"],
                     ^
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:78: syntax error, unexpected '}', expecting '='
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:81: class definition in method body
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb:89: syntax error, unexpected $end, expecting kEND
Please report this bug:
    https://git.io/brew-troubleshooting
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle.rb:8:in `require'
/usr/local/Library/Taps/homebrew/homebrew-bundle/lib/bundle.rb:8
/usr/local/Library/Taps/homebrew/homebrew-bundle/cmd/brew-bundle.rb:16:in `require'
/usr/local/Library/Taps/homebrew/homebrew-bundle/cmd/brew-bundle.rb:16
/usr/local/Library/brew.rb:67:in `require'
/usr/local/Library/brew.rb:67:in `require?'
/usr/local/Library/brew.rb:155

Feature Request: cask args?

Trying to add the --appdir=/Applications arg to cask installs?

Maybe there could just be some sort of global setting at the top of the Brewfile and then it wouldn't need to be added to each of the casks?

Just an idea?

Parse brewfiles line by line

Currently the DSL seems to choke on invalid quotes, causing the whole Brewfile to fail with "missing formula" errors for each single line. I would suggest to either

  • split by newline and parse each line on its own, or
  • validate the whole Brewfile and throw an error if any invalid characters have been encountered.

I'm not a ruby guy and I've only briefly looked at the code, but my guess would be that the first option is actually easier to implement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.