Giter Site home page Giter Site logo

guac's Introduction

Guac ๐Ÿฅ‘

Build Status Code Climate Gem Version GitHub license

Guac is a command line program to update multiple local git repos with one command. Guac stands for git update-all cli, but it's also just a very easy to type command. Furthermore, it's shorthand for Guacamole, e.g.: "Holy Guacamole, this gem makes updating all my repos very fast and easy".

Guac

Guac is written in Ruby, so you'll need to have that installed on your machine, but the functionality itself is language agnostic.

Installation

$ gem install guac

Usage

# Run setup
guac setup

# Show all statuses
guac status
guac st

# Update all on default branch (master)
guac up
# Update all on release_2019
guac up release_2019

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mattboldt/guac. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Copyright

Copyright (c) 2019 Matt Boldt. See MIT License for further details.

guac's People

Contributors

mattboldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

guac's Issues

gua

#!/usr/bin/env ruby
# ln -s $PWD/gua /usr/local/bin/

require 'colorize'

branch = ARGV[0].nil? ? 'develop' : ARGV[0]
repos = %w[kps storefront_api vendor order_service licensing-ui]

def contains?(ary, string)
  ary.any? { |r| r.include?(string) }
end

repos.each do |repo|
  if branch == 'st'
    puts repo.colorize(:blue)

    res = `cd ~/repos/#{repo} && git st`
    color = res.include?('nothing to commit') ? :green : :yellow
    puts res.colorize(color)
  else
    puts "updating #{repo}".colorize(:blue)

    branch_name =
      if repo == 'kps' && branch == 'develop'
        'ams_develop'
      elsif repo == 'kps' && branch == 'master'
        'ams_master'
      else
        branch
      end

    co = `cd ~/repos/#{repo} && git co #{branch_name}`
    update = `cd ~/repos/#{repo} && git up`
    res = [co, update]

    color = if contains?(res, 'Updating')
              :yellow
            elsif contains?(res, 'Failed') || contains?(res, 'error:')
              :red
            else
              :green
            end

    puts update.colorize(color)
    break if color == :red
  end
end

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.