lib/opal/cli_runners/nodejs.rb in opal-1.1.1 vs lib/opal/cli_runners/nodejs.rb in opal-1.2.0.beta1
- old
+ new
@@ -1,7 +1,8 @@
# frozen_string_literal: true
+require 'shellwords'
require 'opal/paths'
require 'opal/cli_runners/system_runner'
module Opal
module CliRunners
@@ -12,13 +13,16 @@
(data[:options] ||= {})[:env] = { 'NODE_PATH' => node_modules }
argv = data[:argv].dup.to_a
argv.unshift('--') if argv.any?
+ opts = Shellwords.shellwords(ENV['NODE_OPTS'] || '')
+
SystemRunner.call(data) do |tempfile|
[
'node',
'--require', "#{__dir__}/source-map-support-node",
+ *opts,
tempfile.path,
*argv
]
end
rescue Errno::ENOENT