makit 0.0.57 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/makit/apache.rb +32 -32
- data/lib/makit/cli/clean.rb +14 -14
- data/lib/makit/cli/clone.rb +59 -59
- data/lib/makit/cli/init.rb +38 -38
- data/lib/makit/cli/main.rb +33 -33
- data/lib/makit/cli/make.rb +54 -54
- data/lib/makit/cli/new.rb +37 -37
- data/lib/makit/cli/nuget_cache.rb +38 -38
- data/lib/makit/cli/pull.rb +31 -31
- data/lib/makit/cli/setup.rb +71 -71
- data/lib/makit/cli/work.rb +21 -21
- data/lib/makit/command_runner.rb +404 -399
- data/lib/makit/commands.rb +21 -21
- data/lib/makit/content/default_gitignore.rb +5 -5
- data/lib/makit/content/default_rakefile.rb +11 -11
- data/lib/makit/content/gem_rakefile.rb +14 -14
- data/lib/makit/data.rb +50 -50
- data/lib/makit/directories.rb +140 -140
- data/lib/makit/directory.rb +200 -200
- data/lib/makit/dotnet.rb +182 -182
- data/lib/makit/environment.rb +127 -127
- data/lib/makit/fileinfo.rb +16 -16
- data/lib/makit/files.rb +47 -47
- data/lib/makit/git.rb +96 -96
- data/lib/makit/gitlab_runner.rb +60 -60
- data/lib/makit/humanize.rb +129 -129
- data/lib/makit/indexer.rb +56 -56
- data/lib/makit/logging.rb +96 -96
- data/lib/makit/markdown.rb +75 -75
- data/lib/makit/mp/basic_object_mp.rb +16 -16
- data/lib/makit/mp/command_request.mp.rb +16 -16
- data/lib/makit/mp/project_mp.rb +210 -210
- data/lib/makit/mp/string_mp.rb +137 -137
- data/lib/makit/nuget.rb +57 -57
- data/lib/makit/protoc.rb +104 -104
- data/lib/makit/serializer.rb +115 -115
- data/lib/makit/show.rb +111 -111
- data/lib/makit/storage.rb +131 -131
- data/lib/makit/symbols.rb +149 -149
- data/lib/makit/tasks.rb +61 -61
- data/lib/makit/tree.rb +37 -37
- data/lib/makit/v1/makit.v1_services_pb.rb +25 -25
- data/lib/makit/version.rb +68 -68
- data/lib/makit/wix.rb +95 -95
- data/lib/makit/yaml.rb +19 -19
- data/lib/makit/zip.rb +17 -17
- data/lib/makit.rb +267 -267
- metadata +3 -5
- data/lib/generated/makit/v1/makit.v1_pb.rb +0 -35
- data/lib/generated/makit/v1/web/link_pb.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec40198af51b3d7b14d577e27484e58c0fd95f5e2c1dc69ff71e368bf100584f
|
4
|
+
data.tar.gz: 666c432d2612bba4ffdcf08b51144ba79fc32052b69d1cbcc2d4fa27de558e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c6cc21b153fc7e5b3e6e58d5127c95ba002784f2646f3097f047d6d83cdc99a58a903c837766be558347d8e47c6b380ec40cbbf0ad31771e0beb5d82720947e
|
7
|
+
data.tar.gz: 4bfe0337afa2c33b3f2716bbbf043f9a66bedf0550d7bbb2ba55e067824d5a85c61279617a2811d2a6fa18c7e16a130211505a085cd54b9f8e0a9d845b9cea25
|
data/lib/makit/apache.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# This module provides classes for the Makit gem.
|
4
|
-
module Makit
|
5
|
-
# This class provide methods for working with the system Environment.
|
6
|
-
#
|
7
|
-
class Apache
|
8
|
-
def self.server_root
|
9
|
-
os = Makit::Environment::get_os
|
10
|
-
if os == "windows"
|
11
|
-
"C:\\Apache24"
|
12
|
-
elsif os == "linux"
|
13
|
-
"/etc/apache2"
|
14
|
-
elsif os == "mac"
|
15
|
-
"/private/etc/apache2"
|
16
|
-
else
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
# default on windows: C:\Apache24
|
20
|
-
# default on linux: /etc/apache2
|
21
|
-
# default on mac: /private/etc/apache2
|
22
|
-
#nil
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.document_root
|
26
|
-
# default on windows: C:\Apache24\htdocs
|
27
|
-
# default on linux: /var/www/html
|
28
|
-
# default on mac: /Library/WebServer/Documents
|
29
|
-
nil
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This module provides classes for the Makit gem.
|
4
|
+
module Makit
|
5
|
+
# This class provide methods for working with the system Environment.
|
6
|
+
#
|
7
|
+
class Apache
|
8
|
+
def self.server_root
|
9
|
+
os = Makit::Environment::get_os
|
10
|
+
if os == "windows"
|
11
|
+
"C:\\Apache24"
|
12
|
+
elsif os == "linux"
|
13
|
+
"/etc/apache2"
|
14
|
+
elsif os == "mac"
|
15
|
+
"/private/etc/apache2"
|
16
|
+
else
|
17
|
+
nil
|
18
|
+
end
|
19
|
+
# default on windows: C:\Apache24
|
20
|
+
# default on linux: /etc/apache2
|
21
|
+
# default on mac: /private/etc/apache2
|
22
|
+
#nil
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.document_root
|
26
|
+
# default on windows: C:\Apache24\htdocs
|
27
|
+
# default on linux: /var/www/html
|
28
|
+
# default on mac: /Library/WebServer/Documents
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/makit/cli/clean.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
|
5
|
-
module Makit
|
6
|
-
module Cli
|
7
|
-
# Define the 'new' subcommand
|
8
|
-
class CleanCommand < Clamp::Command
|
9
|
-
def execute
|
10
|
-
puts "TODO: implement clean command"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
|
5
|
+
module Makit
|
6
|
+
module Cli
|
7
|
+
# Define the 'new' subcommand
|
8
|
+
class CleanCommand < Clamp::Command
|
9
|
+
def execute
|
10
|
+
puts "TODO: implement clean command"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/makit/cli/clone.rb
CHANGED
@@ -1,59 +1,59 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
#require "git"
|
5
|
-
|
6
|
-
module Makit
|
7
|
-
module Cli
|
8
|
-
# Define the 'clone' subcommand
|
9
|
-
class CloneCommand < Clamp::Command
|
10
|
-
parameter "GIT_REPOSITORY", "The git repository url", attribute_name: :git_repository, required: true
|
11
|
-
|
12
|
-
def execute
|
13
|
-
clone_dir = Directories::get_clone_directory(git_repository)
|
14
|
-
puts "cloning repository: #{git_repository} to #{clone_dir}"
|
15
|
-
begin
|
16
|
-
Makit::clone(git_repository)
|
17
|
-
if !Dir.exist?(clone_dir)
|
18
|
-
summary = "failed to clone repository: #{git_repository} to #{clone_dir}\n"
|
19
|
-
summary += "Please check the URL and your network connection.\n"
|
20
|
-
summary += "stdout: #{clone.stdout}\n"
|
21
|
-
summary += "stderr: #{clone.stderr}\n"
|
22
|
-
$stderr.puts summary
|
23
|
-
exit 1
|
24
|
-
end
|
25
|
-
rescue => e
|
26
|
-
# $stderr.puts "failed to clone repository: #{git_repository} to #{clone_dir}"
|
27
|
-
puts e.message
|
28
|
-
exit 1
|
29
|
-
end
|
30
|
-
#puts "size of clone directory: #{clone_dir} is #{Humanize::get_humanized_size(Directory::get_size(clone_dir))}"
|
31
|
-
end
|
32
|
-
|
33
|
-
#def self.clone(git_repository)
|
34
|
-
# make sure a local clone of the repository exists
|
35
|
-
# clone_dir = Directories::get_clone_directory(git_repository)
|
36
|
-
# raise "clone directory already exists: #{clone_dir}" if Dir.exist?(clone_dir)
|
37
|
-
# begin
|
38
|
-
# clone_command = Makit::RUNNER.execute("git clone #{git_repository} #{clone_dir}")
|
39
|
-
# if !Dir.exist?(clone_dir)
|
40
|
-
# summary = "failed to clone repository: #{git_repository} to #{clone_dir}\n"
|
41
|
-
# summary += "Please check the URL and your network connection.\n"
|
42
|
-
# summary += "stdout: #{clone_command.stdout}\n"
|
43
|
-
# summary += "stderr: #{clone_command.stderr}\n"
|
44
|
-
# raise Makit::Error, summary
|
45
|
-
# end
|
46
|
-
#raise "failed to clone repository: #{git_repository} to #{clone_dir}" unless clone_command.success?
|
47
|
-
#Git.clone(git_repository, clone_dir)
|
48
|
-
# rescue => e
|
49
|
-
# summary = "=" * 80 + "\n"
|
50
|
-
# summary += "failed to clone repository: #{git_repository} to #{clone_dir}\n\n"
|
51
|
-
# summary += "Please check the URL and your network connection.\n"
|
52
|
-
# summary += "#{e.message}\n\n"
|
53
|
-
# summary += "=" * 80 + "\n"
|
54
|
-
# raise Makit::Error, summary
|
55
|
-
# end
|
56
|
-
#end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
#require "git"
|
5
|
+
|
6
|
+
module Makit
|
7
|
+
module Cli
|
8
|
+
# Define the 'clone' subcommand
|
9
|
+
class CloneCommand < Clamp::Command
|
10
|
+
parameter "GIT_REPOSITORY", "The git repository url", attribute_name: :git_repository, required: true
|
11
|
+
|
12
|
+
def execute
|
13
|
+
clone_dir = Directories::get_clone_directory(git_repository)
|
14
|
+
puts "cloning repository: #{git_repository} to #{clone_dir}"
|
15
|
+
begin
|
16
|
+
Makit::clone(git_repository)
|
17
|
+
if !Dir.exist?(clone_dir)
|
18
|
+
summary = "failed to clone repository: #{git_repository} to #{clone_dir}\n"
|
19
|
+
summary += "Please check the URL and your network connection.\n"
|
20
|
+
summary += "stdout: #{clone.stdout}\n"
|
21
|
+
summary += "stderr: #{clone.stderr}\n"
|
22
|
+
$stderr.puts summary
|
23
|
+
exit 1
|
24
|
+
end
|
25
|
+
rescue => e
|
26
|
+
# $stderr.puts "failed to clone repository: #{git_repository} to #{clone_dir}"
|
27
|
+
puts e.message
|
28
|
+
exit 1
|
29
|
+
end
|
30
|
+
#puts "size of clone directory: #{clone_dir} is #{Humanize::get_humanized_size(Directory::get_size(clone_dir))}"
|
31
|
+
end
|
32
|
+
|
33
|
+
#def self.clone(git_repository)
|
34
|
+
# make sure a local clone of the repository exists
|
35
|
+
# clone_dir = Directories::get_clone_directory(git_repository)
|
36
|
+
# raise "clone directory already exists: #{clone_dir}" if Dir.exist?(clone_dir)
|
37
|
+
# begin
|
38
|
+
# clone_command = Makit::RUNNER.execute("git clone #{git_repository} #{clone_dir}")
|
39
|
+
# if !Dir.exist?(clone_dir)
|
40
|
+
# summary = "failed to clone repository: #{git_repository} to #{clone_dir}\n"
|
41
|
+
# summary += "Please check the URL and your network connection.\n"
|
42
|
+
# summary += "stdout: #{clone_command.stdout}\n"
|
43
|
+
# summary += "stderr: #{clone_command.stderr}\n"
|
44
|
+
# raise Makit::Error, summary
|
45
|
+
# end
|
46
|
+
#raise "failed to clone repository: #{git_repository} to #{clone_dir}" unless clone_command.success?
|
47
|
+
#Git.clone(git_repository, clone_dir)
|
48
|
+
# rescue => e
|
49
|
+
# summary = "=" * 80 + "\n"
|
50
|
+
# summary += "failed to clone repository: #{git_repository} to #{clone_dir}\n\n"
|
51
|
+
# summary += "Please check the URL and your network connection.\n"
|
52
|
+
# summary += "#{e.message}\n\n"
|
53
|
+
# summary += "=" * 80 + "\n"
|
54
|
+
# raise Makit::Error, summary
|
55
|
+
# end
|
56
|
+
#end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/makit/cli/init.rb
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
require_relative "../../makit"
|
5
|
-
|
6
|
-
module Makit
|
7
|
-
module Cli
|
8
|
-
# Define the 'init' subcommand
|
9
|
-
class InitCommand < Clamp::Command
|
10
|
-
parameter "DIRECTORY", "The directory to init as a git repository", attribute_name: :directory, required: true
|
11
|
-
|
12
|
-
def execute
|
13
|
-
begin
|
14
|
-
Makit::init(directory)
|
15
|
-
puts "initialized local repository: #{directory}"
|
16
|
-
rescue => e
|
17
|
-
$stderr.puts "failed to initialize repository: #{directory}"
|
18
|
-
puts e.message
|
19
|
-
puts e.backtrace
|
20
|
-
exit 1
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
#def self.init(directory)
|
25
|
-
# if !Dir.exist?(directory)
|
26
|
-
# FileUtils.mkdir_p(directory)
|
27
|
-
# end
|
28
|
-
# Dir.chdir(directory) do
|
29
|
-
# init = Makit::RUNNER.execute "git init"
|
30
|
-
# if init.exit_code != 0
|
31
|
-
# raise Makit::Error.new("failed to initialize local repository: #{directory}\n#{Makit::Humanize.get_command_summary(init)}")
|
32
|
-
# end#
|
33
|
-
|
34
|
-
# end
|
35
|
-
#end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
require_relative "../../makit"
|
5
|
+
|
6
|
+
module Makit
|
7
|
+
module Cli
|
8
|
+
# Define the 'init' subcommand
|
9
|
+
class InitCommand < Clamp::Command
|
10
|
+
parameter "DIRECTORY", "The directory to init as a git repository", attribute_name: :directory, required: true
|
11
|
+
|
12
|
+
def execute
|
13
|
+
begin
|
14
|
+
Makit::init(directory)
|
15
|
+
puts "initialized local repository: #{directory}"
|
16
|
+
rescue => e
|
17
|
+
$stderr.puts "failed to initialize repository: #{directory}"
|
18
|
+
puts e.message
|
19
|
+
puts e.backtrace
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
#def self.init(directory)
|
25
|
+
# if !Dir.exist?(directory)
|
26
|
+
# FileUtils.mkdir_p(directory)
|
27
|
+
# end
|
28
|
+
# Dir.chdir(directory) do
|
29
|
+
# init = Makit::RUNNER.execute "git init"
|
30
|
+
# if init.exit_code != 0
|
31
|
+
# raise Makit::Error.new("failed to initialize local repository: #{directory}\n#{Makit::Humanize.get_command_summary(init)}")
|
32
|
+
# end#
|
33
|
+
|
34
|
+
# end
|
35
|
+
#end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/makit/cli/main.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
require_relative "new"
|
5
|
-
require_relative "setup"
|
6
|
-
require_relative "make"
|
7
|
-
require_relative "work"
|
8
|
-
require_relative "clean"
|
9
|
-
require_relative "clone"
|
10
|
-
require_relative "pull"
|
11
|
-
require_relative "init"
|
12
|
-
require_relative "nuget_cache"
|
13
|
-
|
14
|
-
module Makit
|
15
|
-
module Cli
|
16
|
-
# Define the main command which includes the subcommands
|
17
|
-
class MainCommand < Clamp::Command
|
18
|
-
option ["-v", "--version"], :flag, "Show version" do
|
19
|
-
puts "makit version #{Makit::VERSION}"
|
20
|
-
exit(0)
|
21
|
-
end
|
22
|
-
subcommand "new", "Create a new entity", NewCommand
|
23
|
-
subcommand "setup", "Setup a project directory", SetupCommand
|
24
|
-
subcommand "work", "Work on a project", WorkCommand
|
25
|
-
subcommand "make", "Make a project", MakeCommand
|
26
|
-
subcommand "clean", "Clean a project", CleanCommand
|
27
|
-
subcommand "clone", "Clone a git repository", CloneCommand
|
28
|
-
subcommand "pull", "Pull latest changes from a git repository", PullCommand
|
29
|
-
subcommand "init", "Initialize a directory as a git repository", InitCommand
|
30
|
-
subcommand "nuget_cache", "Manage the NuGet cache", NugetCacheCommand
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
require_relative "new"
|
5
|
+
require_relative "setup"
|
6
|
+
require_relative "make"
|
7
|
+
require_relative "work"
|
8
|
+
require_relative "clean"
|
9
|
+
require_relative "clone"
|
10
|
+
require_relative "pull"
|
11
|
+
require_relative "init"
|
12
|
+
require_relative "nuget_cache"
|
13
|
+
|
14
|
+
module Makit
|
15
|
+
module Cli
|
16
|
+
# Define the main command which includes the subcommands
|
17
|
+
class MainCommand < Clamp::Command
|
18
|
+
option ["-v", "--version"], :flag, "Show version" do
|
19
|
+
puts "makit version #{Makit::VERSION}"
|
20
|
+
exit(0)
|
21
|
+
end
|
22
|
+
subcommand "new", "Create a new entity", NewCommand
|
23
|
+
subcommand "setup", "Setup a project directory", SetupCommand
|
24
|
+
subcommand "work", "Work on a project", WorkCommand
|
25
|
+
subcommand "make", "Make a project", MakeCommand
|
26
|
+
subcommand "clean", "Clean a project", CleanCommand
|
27
|
+
subcommand "clone", "Clone a git repository", CloneCommand
|
28
|
+
subcommand "pull", "Pull latest changes from a git repository", PullCommand
|
29
|
+
subcommand "init", "Initialize a directory as a git repository", InitCommand
|
30
|
+
subcommand "nuget_cache", "Manage the NuGet cache", NugetCacheCommand
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/makit/cli/make.rb
CHANGED
@@ -1,54 +1,54 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
#require "git"
|
5
|
-
require "socket"
|
6
|
-
require_relative "../humanize"
|
7
|
-
|
8
|
-
module Makit
|
9
|
-
module Cli
|
10
|
-
# Define the 'make' subcommand
|
11
|
-
class MakeCommand < Clamp::Command
|
12
|
-
parameter "GIT_REPOSITORY", "The git repository URL or NAME", attribute_name: :git_repository, required: true
|
13
|
-
#option ["-f", "--force"], "FORCE", "Force the command to be run, even if a result already exists", attribute_name: :force
|
14
|
-
|
15
|
-
def execute
|
16
|
-
begin
|
17
|
-
# make sure a local clone of the repository exists
|
18
|
-
clone_dir = Directories::get_clone_directory(git_repository)
|
19
|
-
if Dir.exist?(clone_dir)
|
20
|
-
# attempt to the pull the latest changes
|
21
|
-
begin
|
22
|
-
PullCommand::pull(git_repository)
|
23
|
-
rescue => e
|
24
|
-
puts "warning: failed to pull repository: #{git_repository}"
|
25
|
-
end
|
26
|
-
else
|
27
|
-
CloneCommand::clone(git_repository)
|
28
|
-
end
|
29
|
-
rescue => e
|
30
|
-
$stderr.puts "failed to make repository: #{git_repository}"
|
31
|
-
puts "Please check the URL and your network connection."
|
32
|
-
puts e.message
|
33
|
-
exit 1
|
34
|
-
end
|
35
|
-
|
36
|
-
# determine the latest commit id for the repository
|
37
|
-
g = Git.open(clone_dir)
|
38
|
-
latest_commit = g.log.first
|
39
|
-
commit = latest_commit.sha
|
40
|
-
|
41
|
-
begin
|
42
|
-
#make_result = MakeCommand::make(git_repository, commit)
|
43
|
-
make_result = Makit::make(git_repository, commit)
|
44
|
-
puts make_result.summary
|
45
|
-
rescue => e
|
46
|
-
$stderr.puts "failed to make repository: #{git_repository} commit: #{commit}"
|
47
|
-
puts e.message
|
48
|
-
puts Makit::Humanize::get_make_result_summary make_result
|
49
|
-
exit 1
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
#require "git"
|
5
|
+
require "socket"
|
6
|
+
require_relative "../humanize"
|
7
|
+
|
8
|
+
module Makit
|
9
|
+
module Cli
|
10
|
+
# Define the 'make' subcommand
|
11
|
+
class MakeCommand < Clamp::Command
|
12
|
+
parameter "GIT_REPOSITORY", "The git repository URL or NAME", attribute_name: :git_repository, required: true
|
13
|
+
#option ["-f", "--force"], "FORCE", "Force the command to be run, even if a result already exists", attribute_name: :force
|
14
|
+
|
15
|
+
def execute
|
16
|
+
begin
|
17
|
+
# make sure a local clone of the repository exists
|
18
|
+
clone_dir = Directories::get_clone_directory(git_repository)
|
19
|
+
if Dir.exist?(clone_dir)
|
20
|
+
# attempt to the pull the latest changes
|
21
|
+
begin
|
22
|
+
PullCommand::pull(git_repository)
|
23
|
+
rescue => e
|
24
|
+
puts "warning: failed to pull repository: #{git_repository}"
|
25
|
+
end
|
26
|
+
else
|
27
|
+
CloneCommand::clone(git_repository)
|
28
|
+
end
|
29
|
+
rescue => e
|
30
|
+
$stderr.puts "failed to make repository: #{git_repository}"
|
31
|
+
puts "Please check the URL and your network connection."
|
32
|
+
puts e.message
|
33
|
+
exit 1
|
34
|
+
end
|
35
|
+
|
36
|
+
# determine the latest commit id for the repository
|
37
|
+
g = Git.open(clone_dir)
|
38
|
+
latest_commit = g.log.first
|
39
|
+
commit = latest_commit.sha
|
40
|
+
|
41
|
+
begin
|
42
|
+
#make_result = MakeCommand::make(git_repository, commit)
|
43
|
+
make_result = Makit::make(git_repository, commit)
|
44
|
+
puts make_result.summary
|
45
|
+
rescue => e
|
46
|
+
$stderr.puts "failed to make repository: #{git_repository} commit: #{commit}"
|
47
|
+
puts e.message
|
48
|
+
puts Makit::Humanize::get_make_result_summary make_result
|
49
|
+
exit 1
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/makit/cli/new.rb
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
|
5
|
-
module Makit
|
6
|
-
module Cli
|
7
|
-
# Define the 'new' subcommand
|
8
|
-
class NewCommand < Clamp::Command
|
9
|
-
AVAILABLE_TYPES = %w[gem crate nuget].freeze
|
10
|
-
option "--list", :flag, "List available types"
|
11
|
-
option ["-o", "--output"], "OUTPUT_DIR", "Specify output directory", default: "."
|
12
|
-
option ["-t", "--type"], "TYPE", "Type of the new entity", default: "gem"
|
13
|
-
parameter "TYPE", "Type of the new entity", attribute_name: :type, required: false
|
14
|
-
parameter "NAME", "Name of the new entity", attribute_name: :name, required: false
|
15
|
-
parameter "DIRECTORY", "The output directory", attribute_name: :name, required: false
|
16
|
-
|
17
|
-
def execute
|
18
|
-
if list?
|
19
|
-
puts "Available types:"
|
20
|
-
AVAILABLE_TYPES.each { |t| puts " - #{t}" }
|
21
|
-
else
|
22
|
-
if type.nil? || name.nil?
|
23
|
-
puts "Error: TYPE and NAME are required unless using --list"
|
24
|
-
exit(1)
|
25
|
-
end
|
26
|
-
|
27
|
-
unless AVAILABLE_TYPES.include?(type)
|
28
|
-
puts "Error: '#{type}' is not a valid type. Use --list to see available types."
|
29
|
-
exit(1)
|
30
|
-
end
|
31
|
-
|
32
|
-
puts "Creating a new #{type} named #{name}."
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
|
5
|
+
module Makit
|
6
|
+
module Cli
|
7
|
+
# Define the 'new' subcommand
|
8
|
+
class NewCommand < Clamp::Command
|
9
|
+
AVAILABLE_TYPES = %w[gem crate nuget].freeze
|
10
|
+
option "--list", :flag, "List available types"
|
11
|
+
option ["-o", "--output"], "OUTPUT_DIR", "Specify output directory", default: "."
|
12
|
+
option ["-t", "--type"], "TYPE", "Type of the new entity", default: "gem"
|
13
|
+
parameter "TYPE", "Type of the new entity", attribute_name: :type, required: false
|
14
|
+
parameter "NAME", "Name of the new entity", attribute_name: :name, required: false
|
15
|
+
parameter "DIRECTORY", "The output directory", attribute_name: :name, required: false
|
16
|
+
|
17
|
+
def execute
|
18
|
+
if list?
|
19
|
+
puts "Available types:"
|
20
|
+
AVAILABLE_TYPES.each { |t| puts " - #{t}" }
|
21
|
+
else
|
22
|
+
if type.nil? || name.nil?
|
23
|
+
puts "Error: TYPE and NAME are required unless using --list"
|
24
|
+
exit(1)
|
25
|
+
end
|
26
|
+
|
27
|
+
unless AVAILABLE_TYPES.include?(type)
|
28
|
+
puts "Error: '#{type}' is not a valid type. Use --list to see available types."
|
29
|
+
exit(1)
|
30
|
+
end
|
31
|
+
|
32
|
+
puts "Creating a new #{type} named #{name}."
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,38 +1,38 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "clamp"
|
4
|
-
|
5
|
-
module Makit
|
6
|
-
module Cli
|
7
|
-
# Define the 'nuget_cache' subcommand
|
8
|
-
#
|
9
|
-
# nuget_cache Google.Protobuf
|
10
|
-
# nuget_cache Google.Protobuf 3.27.2
|
11
|
-
class NugetCacheCommand < Clamp::Command
|
12
|
-
parameter "PACKAGE", "The package id", attribute_name: :package, required: true
|
13
|
-
parameter "VERSION", "The package version", attribute_name: :version, default: nil
|
14
|
-
|
15
|
-
def execute
|
16
|
-
if version.nil?
|
17
|
-
# look up the latest version of the package
|
18
|
-
raise "TODO: implement latest version lookup"
|
19
|
-
end
|
20
|
-
|
21
|
-
# download the package
|
22
|
-
url = "https://www.nuget.org/api/v2/package/#{package}/#{version}"
|
23
|
-
if !url.nil?
|
24
|
-
# download the package
|
25
|
-
|
26
|
-
raise "TODO: implement package download"
|
27
|
-
puts "url: #{url}"
|
28
|
-
puts "relative directoyr: #{Makit::Environment.get_relative_directory(url)}"
|
29
|
-
puts "work directory: #{Makit::Environment.get_work_directory(url)}"
|
30
|
-
end
|
31
|
-
puts "TODO: implement work command"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def install_cache_package(package, version)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "clamp"
|
4
|
+
|
5
|
+
module Makit
|
6
|
+
module Cli
|
7
|
+
# Define the 'nuget_cache' subcommand
|
8
|
+
#
|
9
|
+
# nuget_cache Google.Protobuf
|
10
|
+
# nuget_cache Google.Protobuf 3.27.2
|
11
|
+
class NugetCacheCommand < Clamp::Command
|
12
|
+
parameter "PACKAGE", "The package id", attribute_name: :package, required: true
|
13
|
+
parameter "VERSION", "The package version", attribute_name: :version, default: nil
|
14
|
+
|
15
|
+
def execute
|
16
|
+
if version.nil?
|
17
|
+
# look up the latest version of the package
|
18
|
+
raise "TODO: implement latest version lookup"
|
19
|
+
end
|
20
|
+
|
21
|
+
# download the package
|
22
|
+
url = "https://www.nuget.org/api/v2/package/#{package}/#{version}"
|
23
|
+
if !url.nil?
|
24
|
+
# download the package
|
25
|
+
|
26
|
+
raise "TODO: implement package download"
|
27
|
+
puts "url: #{url}"
|
28
|
+
puts "relative directoyr: #{Makit::Environment.get_relative_directory(url)}"
|
29
|
+
puts "work directory: #{Makit::Environment.get_work_directory(url)}"
|
30
|
+
end
|
31
|
+
puts "TODO: implement work command"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def install_cache_package(package, version)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|