Download internal/ui/common/bash.go from SaylorTwift/crush: direct link, hf CLI and curl.
- Browser
- Download file 377 Bytes
-
https://huggingface.co/SaylorTwift/crush/resolve/main/internal/ui/common/bash.go
- Command line
-
hf download hf://SaylorTwift/crush/internal/ui/common/bash.go
-
curl -L -o bash.go https://huggingface.co/SaylorTwift/crush/resolve/main/internal/ui/common/bash.go
377 Bytes
| package common | |
| import ( | |
| "fmt" | |
| "strings" | |
| ) | |
| // StripBashDisplayPrefix removes a leading "cd <path> && " prefix from a | |
| // command for display purposes, but only when the cd target is exactly the | |
| // project working directory. | |
| func StripBashDisplayPrefix(cmd, workingDir string) string { | |
| prefix := fmt.Sprintf("cd %s && ", workingDir) | |
| return strings.TrimPrefix(cmd, prefix) | |
| } | |