File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ func main() {
2424 var remainingArgs = commandRun .FilterArgs (args [1 :])
2525
2626 if cmdFlags .Env {
27- print ( shell .ShowEnv (cwd ) )
28- os . Exit ( 0 )
27+ shell .ShowEnv (cwd )
28+ return
2929 }
3030
3131 if len (remainingArgs ) == 0 {
Original file line number Diff line number Diff line change 11package shell
22
33import (
4+ "fmt"
5+ "os"
46 "strings"
57
68 "github.com/samtv12345/gnpm/filemanagement"
79)
810
9- func ShowEnv (cwd string ) string {
11+ func ShowEnv (cwd string ) {
1012 currentParent , err := filemanagement .FindParentLinkModuleDir (cwd )
1113 if err != nil {
1214 panic (err )
@@ -16,12 +18,14 @@ func ShowEnv(cwd string) string {
1618 panic (err )
1719 }
1820 if strings .Contains (currentShell , "cmd.exe" ) {
19- return "set PATH=" + * currentParent + ";%PATH%"
21+ println ("set PATH=" + * currentParent + ";%PATH%" )
22+ return
2023 }
2124
2225 if strings .Contains (currentShell , "powershell.exe" ) {
23- return "$env:PATH=\" " + * currentParent + ";$env:PATH\" "
26+ println ("$env:PATH=\" " + * currentParent + ";$env:PATH\" " )
27+ return
2428 }
2529
26- return "export PATH=" + * currentParent + ":$ PATH"
30+ fmt . Printf ( "export PATH=%s:%s \n " , * currentParent , os . Getenv ( " PATH"))
2731}
You can’t perform that action at this time.
0 commit comments