Sha256: e3ef27b64f58a161d4cb7fe27d0df72e45d5b6f5c35a9ec14dfbc9b56dd87324
Contents?: true
Size: 1.01 KB
Versions: 25
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true require "clamp" require_relative "../../makit" module Makit module Cli # Define the 'init' subcommand class InitCommand < Clamp::Command parameter "DIRECTORY", "The directory to init as a git repository", attribute_name: :directory, required: true def execute begin Makit::init(directory) puts "initialized local repository: #{directory}" rescue => e $stderr.puts "failed to initialize repository: #{directory}" puts e.message puts e.backtrace exit 1 end end #def self.init(directory) # if !Dir.exist?(directory) # FileUtils.mkdir_p(directory) # end # Dir.chdir(directory) do # init = Makit::RUNNER.execute "git init" # if init.exit_code != 0 # raise Makit::Error.new("failed to initialize local repository: #{directory}\n#{Makit::Humanize.get_command_summary(init)}") # end# # end #end end end end
Version data entries
25 entries across 25 versions & 1 rubygems