Code Monkey home page Code Monkey logo

dotbot-brew's Introduction

Dotbot brew plugin

macOS Ubuntu

Plugin for dotbot that adds brew and cask directives. It allows installation of packages using brew and brew cask on OS X. In case brew is not installed, it will be automatically loaded and configured. The plugin itself is pretty silly as it doesn’t handle updates and fails on unsupported operating systems.

Installation

Just add it as submodule of your dotfiles repository.

git submodule add https://github.com/d12frosted/dotbot-brew.git

Modify your install script, so it automatically enables brew plugin.

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" --plugin-dir dotbot-brew -c "${CONFIG}" "${@}"

Usage

In your install.conf.yaml use brew directive to list all packages to be installed using brew. The same works with cask and brewfile. For example:

- brewfile:
    - Brewfile
    - brew/Brewfile

- tap:
    - caskroom/fonts

- brew:
    - git
    - git-lfs
    - emacs --with-cocoa --with-gnutls --with-librsvg --with-imagemagick --HEAD --use-git-head

- brew: [gnupg, gnupg2]

- cask: [colorpicker, vlc]

dotbot-brew's People

Contributors

borisrorsvort avatar captnblubber avatar d12frosted avatar dependabot[bot] avatar dsifford avatar felipecrs avatar fuzzycode avatar jdigger avatar mbode avatar miguelandres 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

Watchers

 avatar  avatar  avatar

dotbot-brew's Issues

Run CI on cron

Since we know brew does breaking changes time to time (which is totlly fine), and this repository is not actively developed, it would be nice to run tests every day so that we proactively know if it breaks.

Python Version Issue - Typing Not Allowed

I think the code that gets executed when running the install script runs under python 2.7. It does on my machine, at least, and I'm not sure how to change that.

8:35:56 [.dotfiles] (master) % ./install
Traceback (most recent call last):
  File "/Users/mattdavis/.dotfiles/dotbot/bin/dotbot", line 45, in <module>
    main()
  File "/Users/mattdavis/.dotfiles/dotbot/bin/dotbot", line 42, in main
    dotbot.cli.main()
  File "/Users/mattdavis/.dotfiles/dotbot/dotbot/cli.py", line 132, in main
    module.load(abspath)
  File "/Users/mattdavis/.dotfiles/dotbot/dotbot/util/module.py", line 10, in load
    plugin = load_module(module_name, path)
  File "/Users/mattdavis/.dotfiles/dotbot/dotbot/util/module.py", line 33, in load_module
    return imp.load_source(module_name, path)
  File "/Users/mattdavis/.dotfiles/dotbot-brew/brew.py", line 13
    _directives: Mapping[str, Callable] = {}
               ^
SyntaxError: invalid syntax

Line 13 of brew.py is this type stuff. Hadn't seen that in python before, but I guess it's valid in 3.x.

_directives: Mapping[str, Callable] = {}

If I print sys.version from dotbot/bin/dotbot, I see this.

2.7.16 (default, Sep  6 2021, 07:39:44) 
[GCC Apple LLVM 12.0.5 (clang-1205.0.19.59.6) [+internal-os, ptrauth-isa=deploy

Any thoughts here? I'd like to use your plugin, but something's wrong.

Use "brew bundle --verbose" for brewfile directives

brew bundle shows prettified output with green colors after installing a package and no styling in case of the package being already installed, so it looks great.

brew bundle --verbose shows more details on what is actually going on, in particular on whether a particular package is being installed.

the non-verbose version is prettier but it looks like it's stuck or something on large installs. It doesn't show enough information.

Consider changing this?

Initial `brew` install does not add command to `$PATH`

It seems like installing brew (on macOS, at least) has a few required set-up steps after the initial download

- Run these two commands in your terminal to add Homebrew to your PATH:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/alexlafroscia/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

While the first one of those is not something I would expect this plugin to do, that second command ends up necessary; without it, the rest of the process of actually using the brew command fails due to brew not actually being available in the $PATH of the shell that dotbot is running in.

As a short-term work-around, after dotbot failed to install my brew packages, was to run that second command and then try dotbot a second time. This worked, but getting it all installed the first time is the goal!

Add support for services

==> Caveats
To have launchd start tor now and restart at login:
  brew services start tor
Or, if you don't want/need a background service you can just run:
  tor

It would be nice if you could enable services to automatically start on reboots.

Feature request: Flatten lists prior to passing to plugins so that yaml anchors can be used

Hello,

Posting this request here from anishathalye/dotbot#122

My request is fairly simple. I'm in a situation where I'm jumping between a macbook and a linux machine and I'm using both dotbot-pacuar and dotbot-brew to maintain a list of my packages for both machines.

The lists contain, for the most part, the same exact packages with a few here and there differences.

Currently, there's no way to use reference anchors in the plugin yaml file so I have to write my package lists like this:

- pacaur:
  - package1
  - package2
  - package3
  - package4
  - package5
  - linux-specific1

- brew:
  - package1
  - package2
  - package3
  - package4
  - package5
  - mac-specific1
  - mac-specific2

As you can see, there's a lot of unnecesary repeats between both lists.

What I'd like to do instead is this:

- &common
  - package1
  - package2
  - package3
  - package4
  - package5

- pacaur:
  - *common
  - linux-specific1

- brew:
  - *common
  - mac-specific1
  - mac-specific2

This almost works right now, but the hangup is that dotbot doesn't first flatten the lists prior to passing them to the plugins. So what the plugins end up getting is this:

- pacaur:
  -
    - package1
    - package2
    - package3
    - package4
    - package5
  - 
    - linux-specific1

- brew:
  - 
    - package1
    - package2
    - package3
    - package4
    - package5
  - 
    - mac-specific1
    - mac-specific2

Hope that makes sense. Thanks for considering! 😄

Add option for conditional installs

There are programs you may want to install only on your personal computer and not on your work computer, and vice versa. Add an option to conditionally run a set of installs depending on some condition. I have a (probably sloppy considering my trash shell scripting skills) example of this in my dotfiles.

Something like

brew:
    if: $(who | grep "some_specific_condition")
    programs:
         - work_only_program

Clean install fails at cask items

Here's what happens on a brand new OSX installation:

Installing from file install.conf/Brewfile
Updating Homebrew...
==> Tapping homebrew/bundle
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 5331 (delta 13), reused 18 (delta 6), pack-reused 5299
Receiving objects: 100% (5331/5331), 1.20 MiB | 1.16 MiB/s, done.
Resolving deltas: 100% (3117/3117), done.
Tapped 1 command (104 files, 1.5MB).
Error: Cask 'workflowy' is unavailable: No Cask with this name exists.
Installing workflowy has failed!
Error: Cask 'google-chrome' is unavailable: No Cask with this name exists.
Installing google-chrome has failed!
Error: Cask 'firefox' is unavailable: No Cask with this name exists.

It seems that the cask has not initialised yet when dotbot-brew is trying to install casks.
Running any cask command manually in terminal will trigger the init process, like so:

brew cask info 
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 4, done.
...

It's probably an easy fix. What do you think?

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.