7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/devkitkat/service/predefined_command/add_script.rb', line 7
def to_script
names = command.args.any? ? command.args : %w[configure unconfigure start]
FileUtils.mkdir_p(service.script_dir)
names.map do |name|
file_path = File.join(service.script_dir, name)
"if [[ ! -f \"\#{file_path}\" ]]; then\n cat > \#{file_path} << EOL\n#!/bin/bash\nset -e\n\n# TODO: Define scripts\nEOL\n chmod 755 \#{file_path}\nfi\n EOS\n end.join(\"\\n\")\nend\n"
|