11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/makit/setup/runner.rb', line 11
def self.run
if File.exist?(".git")
if !File.exist?(".gitignore")
File.write(".gitignore", Makit::Content::GITIGNORE)
end
end
return unless File.exist?(".makit.json")
begin
project = Makit::Serializer.open(".makit.json", Makit::Configuration::Project)
if defined?(Makit::VERSION) && (project.version.nil? || project.version.empty?)
project.version = Makit::VERSION
end
current_content = File.read(".makit.json")
pretty_content = project.to_json_pretty
File.write(".makit.json", pretty_content) if current_content.strip != pretty_content.strip
rescue StandardError
raise "Error opening .makit.json"
end
project_type = project.project_type
case project_type
when "classlib"
Makit::Setup::ClassLib.run
when "razorclasslib"
Makit::Setup::RazorClassLib.run
when "gem"
Makit::Setup::Gem.run
else
Makit::Logging.default_logger.warn("Unsupported project type: #{project_type}")
end
end
|