Class: Opal::CliRunners::Deno

Inherits:
Object
  • Object
show all
Defined in:
lib/opal/cli_runners/deno.rb

Defined Under Namespace

Classes: MissingDeno

Class Method Summary collapse

Class Method Details

.call(data) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/opal/cli_runners/deno.rb', line 11

def self.call(data)
  argv = data[:argv].dup.to_a

  SystemRunner.call(data) do |tempfile|
    [
      'deno',
      'run',
      '--allow-read',
      '--allow-write',
      tempfile.path,
      *argv
    ]
  end
rescue Errno::ENOENT
  raise MissingDeno, 'Please install Deno to be able to run Opal scripts.'
end