Skip to content

Commit

Permalink
Add unix shebang for executables generated by analysis tests
Browse files Browse the repository at this point in the history
See bazelbuild#18940 for more details. I've also wanted to update the tests, but it seems that this code doesn't have any test coverage (or I couldn't find it). To be fair, it is probably simple enough to not need it.

Closes bazelbuild#19780.

PiperOrigin-RevId: 572627238
Change-Id: I3685e782833712199a2696ac67477b9f2bb2f7ae
  • Loading branch information
keddad authored and copybara-github committed Oct 11, 2023
1 parent ea26cd3 commit 396152f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public static void writeAnalysisTestAction(
StringBuilder sb = new StringBuilder();
if (ruleContext.isExecutedOnWindows()) {
sb.append("@echo off\n");
} else {
sb.append("#!/bin/sh\n");
}
for (String line : Splitter.on("\n").split(escapedMessage)) {
sb.append("echo ").append(line).append("\n");
Expand Down

0 comments on commit 396152f

Please sign in to comment.