How do you call a wrapper script needed for when priv folder is unavailable?

I am trying to get Wallaby to run inside of an escript, but it depends on a small wrapper script (run_phantom.js) that lives in the priv folder and is not bundled when my app is built as an escript. My understanding is this wrapper script is critical because it protects against the phantomjs becoming a zombie process. is currently being started by with the following code.

  def init(_) do
    port = find_available_port()
    local_storage = tmp_local_storage(){:spawn_executable, String.to_charlist(script_path())},
      [:binary, :stream, :use_stdio, :exit_status, args: script_args(port, local_storage)])

    {:ok, %{running: false, awaiting_url: [], base_url: "http://localhost:#{port}/", local_storage: local_storage}}

  def script_args(port, local_storage) do
    ] ++ args()

  defp script_path do
    Path.absname("priv/", Application.app_dir(:wallaby))

However, since I can’t access the priv folder from an escript, I thought I might save the script contents into a module variable like this:

@external_resource "priv/"
@run_phantom_contents! "priv/"

Since the original command was run like ./priv/ phantom --webdriver=4444, what would be the equivalent command if the contents of the wrapper script was saved in @run_phantom_contents? I tried using eval but it’s a shell command and not an executable so it doesn’t seem like it’s compatible with