1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:29:03 -08:00

support cosmopolitan perl in shelly

This commit is contained in:
Connor Olding 2022-08-29 22:05:38 -07:00
parent ba2982b880
commit 07c2d3809c

View file

@ -12,9 +12,15 @@ my @shells = <zsh osh fish ion bash ash busybox ksh tcsh csh rc dash>;
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";
}
}