Skip to content

Commit 6592f7e

Browse files
authored
exec in wrapper script if we aren't in the repl (#306)
1 parent 8447da8 commit 6592f7e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scala/scala.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,20 @@ def _write_launcher(ctx, rjars, main_class, jvm_flags, args="", wrapper_preamble
389389
javabin = "%s/%s" % (runfiles_root, ctx.executable._java.short_path)
390390
template = ctx.attr._java_stub_template.files.to_list()[0]
391391

392+
exec_str = ""
393+
if wrapper_preamble == "":
394+
exec_str = "exec "
395+
392396
wrapper = ctx.new_file(ctx.label.name + "_wrapper.sh")
393397
ctx.file_action(
394398
output = wrapper,
395399
content = """#!/bin/bash
396400
{preamble}
397401
398-
{javabin} "$@" {args}
402+
{exec_str}{javabin} "$@" {args}
399403
""".format(
400404
preamble=wrapper_preamble,
405+
exec_str=exec_str,
401406
javabin=javabin,
402407
args=args,
403408
),

0 commit comments

Comments
 (0)