mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
15 lines
370 B
Ruby
Executable File
15 lines
370 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
cmdline = ['chuck', '--caution-to-the-wind']
|
|
cmdline << ARGV.shift if ARGV[0] == '--silent'
|
|
|
|
scriptfile = ARGV[0]
|
|
script = File.readlines(scriptfile)
|
|
imports = script.grep(%r{^ *// *@import (.+)}) { $1 }
|
|
import_files = imports.flat_map { |i| Dir[i] }
|
|
cmdline += import_files
|
|
cmdline << scriptfile
|
|
|
|
ENV['CHUCK_ARGS'] = ARGV.join("\a")
|
|
exec(*cmdline)
|