#! /usr/bin/env ruby # frozen_string_literal: true # because rubygems shims assume a gem's executables are Ruby require "ariadne/view_components/commands" begin command = [Ariadne::ViewComponents::Commands.executable, *ARGV] puts command.inspect if Gem.win_platform? # use system rather than exec as exec inexplicably fails to find the executable on Windows # see related https://github.com/rubys/sprockets-esbuild/pull/4 system(*command, exception: true) else exec(*command) end rescue Ariadne::ViewComponents::Commands::UnsupportedPlatformException, Ariadne::ViewComponents::Commands::ExecutableNotFoundException => e $stderr.puts("ERROR: " + e.message) exit(1) end