Sha256: ba3e267aae9be86578a62cf0b706fb388c70a590316870f944e4224c08329138

Contents?: true

Size: 897 Bytes

Versions: 1

Compression:

Stored size: 897 Bytes

Contents

# frozen_string_literal: true

require "thor"
require "jive"
require "pathname"

module Jive
  module Cli
    class App < Thor
      def self.exit_on_failure?
        true
      end

      desc "cd <org>/<project>", "cd to ~/src/github.com/<org>/<project>"
      def cd(slug)
        runner.run_safely do
          Git.new(runner).cd(slug)
        end
      end

      desc "clone <org>/<project>", "git clone to ~/src/github.com/<org>/<project>"
      def clone(slug)
        runner.run_safely do
          Git.new(runner).clone(slug)
        end
      end

      desc "setup", "provide instructions to integrate into shell"
      def setup
        say <<~MESSAGE
          Include the following in your ~/.bash_profile

            source #{::Jive.root.join("jive.sh")}
        MESSAGE
      end

      private

      def runner
        @runner ||= ::Jive::Shell.new
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jive-0.2.2 lib/jive/cli.rb