Skip to content

Commit d86389a

Browse files
committed
Get rid if strings std library dependency in os (os std should never depend on another std library to avoid circular dependencies)
1 parent 719a37f commit d86389a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

std/os.tsh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import "strings"
2-
31
func Shell() string {
42
shell := "unknown"
3+
win := "%OS%"
54

6-
if strings.HasPrefix("%OS%", "Win") {
5+
if win[:3] == "Win" {
76
shell = "batch"
87
} else {
98
stdout, stderr, code := @ps("-p", "$$", "-o", "args=") | @cut("-d", " ", "-f1") | @grep("-o", "-e", `"[0-9a-zA-Z][0-9a-zA-Z]*$"`)

0 commit comments

Comments
 (0)