lib/sewing_kit/webpack/compiler.rb in sewing_kit-0.7.1 vs lib/sewing_kit/webpack/compiler.rb in sewing_kit-0.8.0
- old
+ new
@@ -1,19 +1,20 @@
+# frozen_string_literal: true
module SewingKit
module Webpack
class Compiler
def compile
result = Kernel.system(
{ 'NODE_ENV' => node_env },
*command,
chdir: Rails.root.to_s,
out: $stdout,
- err: $stderr,
+ err: $stderr
)
- if !result
- puts "sewing-kit compile failed with error code #{$?}"
+ unless result
+ puts "sewing-kit compile failed with error code #{$CHILD_STATUS}"
exit(1)
end
result
end
@@ -22,14 +23,13 @@
def command
[
'node_modules/.bin/sewing-kit',
'build',
'--mode',
- node_env,
+ node_env
].reject(&:empty?)
end
- private
def node_env
ENV['NODE_ENV'] || Rails.env.to_s
end
end
end