Skip to content

Commit ea22c97

Browse files
authored
Fix missing generated files (#881)
* Adding missing code from function helper template * Add missing templates to fixtures
1 parent 4627dcd commit ea22c97

File tree

6 files changed

+131
-1
lines changed

6 files changed

+131
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require "colorize"
2+
3+
# These are helper methods provided to help keep your code
4+
# clean. Add new methods, or alter these as needed.
5+
6+
def notice(message : String) : Nil
7+
puts "\n#{message}"
8+
end
9+
10+
def print_done : Nil
11+
puts "✔ Done"
12+
end
13+
14+
def print_error(message : String) : Nil
15+
puts "There is a problem with your system setup:\n".colorize.red.bold
16+
puts "#{message}\n".colorize.red.bold
17+
Process.exit(1)
18+
end
19+
20+
def command_not_found(command : String) : Bool
21+
Process.find_executable(command).nil?
22+
end
23+
24+
def command_not_running(command : String, *args) : Bool
25+
output = IO::Memory.new
26+
code = Process.run(command, args, output: output).exit_code
27+
code > 0
28+
end
29+
30+
def run_command(command : String, *args) : Nil
31+
Process.run(command, args, output: STDOUT, error: STDERR, input: STDIN)
32+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require "colorize"
2+
3+
# These are helper methods provided to help keep your code
4+
# clean. Add new methods, or alter these as needed.
5+
6+
def notice(message : String) : Nil
7+
puts "\n#{message}"
8+
end
9+
10+
def print_done : Nil
11+
puts "✔ Done"
12+
end
13+
14+
def print_error(message : String) : Nil
15+
puts "There is a problem with your system setup:\n".colorize.red.bold
16+
puts "#{message}\n".colorize.red.bold
17+
Process.exit(1)
18+
end
19+
20+
def command_not_found(command : String) : Bool
21+
Process.find_executable(command).nil?
22+
end
23+
24+
def command_not_running(command : String, *args) : Bool
25+
output = IO::Memory.new
26+
code = Process.run(command, args, output: output).exit_code
27+
code > 0
28+
end
29+
30+
def run_command(command : String, *args) : Nil
31+
Process.run(command, args, output: STDOUT, error: STDERR, input: STDIN)
32+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require "colorize"
2+
3+
# These are helper methods provided to help keep your code
4+
# clean. Add new methods, or alter these as needed.
5+
6+
def notice(message : String) : Nil
7+
puts "\n#{message}"
8+
end
9+
10+
def print_done : Nil
11+
puts "✔ Done"
12+
end
13+
14+
def print_error(message : String) : Nil
15+
puts "There is a problem with your system setup:\n".colorize.red.bold
16+
puts "#{message}\n".colorize.red.bold
17+
Process.exit(1)
18+
end
19+
20+
def command_not_found(command : String) : Bool
21+
Process.find_executable(command).nil?
22+
end
23+
24+
def command_not_running(command : String, *args) : Bool
25+
output = IO::Memory.new
26+
code = Process.run(command, args, output: output).exit_code
27+
code > 0
28+
end
29+
30+
def run_command(command : String, *args) : Nil
31+
Process.run(command, args, output: STDOUT, error: STDERR, input: STDIN)
32+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require "colorize"
2+
3+
# These are helper methods provided to help keep your code
4+
# clean. Add new methods, or alter these as needed.
5+
6+
def notice(message : String) : Nil
7+
puts "\n#{message}"
8+
end
9+
10+
def print_done : Nil
11+
puts "✔ Done"
12+
end
13+
14+
def print_error(message : String) : Nil
15+
puts "There is a problem with your system setup:\n".colorize.red.bold
16+
puts "#{message}\n".colorize.red.bold
17+
Process.exit(1)
18+
end
19+
20+
def command_not_found(command : String) : Bool
21+
Process.find_executable(command).nil?
22+
end
23+
24+
def command_not_running(command : String, *args) : Bool
25+
output = IO::Memory.new
26+
code = Process.run(command, args, output: output).exit_code
27+
code > 0
28+
end
29+
30+
def run_command(command : String, *args) : Nil
31+
Process.run(command, args, output: STDOUT, error: STDERR, input: STDIN)
32+
end

src/lucky_cli/src_template.cr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ class SrcTemplate
116116
ECR.embed("#{__DIR__}/../web_app_skeleton/script/system_check.cr.ecr", io)
117117
end
118118
script_dir.add_folder("helpers") do |helpers_dir|
119-
helpers_dir.add_file("function_helpers.cr")
119+
helpers_dir.add_file("function_helpers.cr") do |io|
120+
ECR.embed("#{__DIR__}/../web_app_skeleton/script/helpers/function_helpers.cr.ecr", io)
121+
end
120122
end
121123
end
122124
root_dir.insert_folder("spec", spec_folder)

src/web_app_skeleton/script/helpers/function_helpers.cr renamed to src/web_app_skeleton/script/helpers/function_helpers.cr.ecr

File renamed without changes.

0 commit comments

Comments
 (0)