From 07c2d3809ceb2e242389fc3d9b49419b9d67273d Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 29 Aug 2022 22:05:38 -0700 Subject: [PATCH] support cosmopolitan perl in shelly --- sh/shelly | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sh/shelly b/sh/shelly index 610cc28..f2b443a 100755 --- a/sh/shelly +++ b/sh/shelly @@ -12,9 +12,15 @@ my @shells = ; for my $s (@shells) { for my $p (@PATH) { + #print STDERR "path: $p\n"; my $fp = File::Spec->join($p, $s); my @argv = $s eq "busybox" ? ("sh", "-i") : ($s, "-i"); - exec {$fp} @argv if -f $fp and -e "$fp"; + if (-d "/C/") { + # probably Windows. + exec {"$fp.exe"} @argv if -f "$fp.exe" and -e "$fp.exe"; + } else { + exec {$fp} @argv if -f $fp and -e $fp; + } #print STDERR "fail: $fp\n"; } }