Code Monkey home page Code Monkey logo

brewenv's Introduction

brewenv

brewenv allows you easily manage and switch between multiple Homebrew environments. In fact, it is just helps you to download Homebrew to selected directory and hooks your $PATH.

Installation

From git

  1. Clone the repository:
$ git clone https://github.com/russtone/brewenv ~/.brewenv
  1. Add brewenv to your $PATH:
export PATH="$HOME/.brewenv:$PATH"
  1. Set your $BREWENV_HOME (place, where your global environments will be placed):

By default it will be $XDG_DATA_HOME/brewenv or ~/.brewenv (if $XDG_DATA_HOME is not set).

export BREWENV_HOME="$HOME/.brewenv"
  1. Add this lines to your .bashrc or .zshrc:
if command -v brewenv >/dev/null 2>&1; then
  eval "$(brewenv init -)"
fi

Usage

Global environments

Global environments are installations of Homebrew created in your $BREWENV_HOME/environments directory.

# Create new global environment
$ brewenv create -g pentest
Downloading homebrew...
Homebrew successfully downloaded to '/Users/russtone/.local/share/brewenv/environments/pentest'

# Switch to created environment
$ brewenv activate -g pentest
$ which brew
/Users/russtone/.local/share/brewenv/environments/pentest/bin/brew

# Install some Homebrew stuff
...

# Switch back to default environment
$ brewenv deactivate
$ which brew
/usr/local/bin/brew

Local envrionments

Local environments are more like per project installations of Homebrew.

# Go to your project directory
$ cd ~/Projects/some-project

# Create local Homebrew environment in current project directory
$ brewenv create benv
Downloading homebrew...
Homebrew successfully downloaded to 'benv'

# Switch to your local Homebrew environment
$ brewenv activate benv
$ which brew
/Users/russtone/Projects/some-project/benv/bin/brew

# Install some Homebrew stuff
...

# Switch back to default environment
$ brewenv deactivate
$ which brew
/usr/local/bin/brew

brewenv's People

Contributors

nt0xa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

brewenv

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.