Skip to content

Commit 5bed377

Browse files
committed
Fix wrong Windows detection
1 parent 5e4342e commit 5bed377

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/org/embulk/output/CommandFileOutputPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public List<String> get() {
8686

8787
public ShellFactory build() {
8888
String osName = System.getProperty("os.name");
89-
if(osName.contains("Windows")) {
89+
if(osName.indexOf("Windows") >= 0) {
9090
this.shell = ImmutableList.of("PowerShell.exe", "-Command");
9191
} else {
9292
this.shell = ImmutableList.of("sh", "-c");

src/test/java/org/embulk/output/TestCommandFileOutputPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void testShell() {
2929
List<String> shell = shellFactory.get();
3030
String osName = System.getProperty("os.name");
3131
List<String> actualShellCmd;
32-
if (osName.contains("Windows")) {
32+
if (osName.indexOf("Windows") >= 0) {
3333
actualShellCmd = ImmutableList.of("PowerShell.exe", "-Command");
3434
} else {
3535
actualShellCmd = ImmutableList.of("sh", "-c");

0 commit comments

Comments
 (0)