Browse Source

add link support for windows

pull/103/head
Lunny Xiao 11 years ago
parent
commit
1c7dca2d8e
  1. 5
      cmd/build.go
  2. 13
      cmd/helper.go
  3. 10
      cmd/helper_windows.go

5
cmd/build.go

@ -121,11 +121,6 @@ func getChildPkgs(cpath string, ppkg *doc.Pkg, cachePkgs map[string]*doc.Pkg) er
return nil
}
func makeLink(oldPath, newPath string) error {
cmd := exec.Command("ln", "-s", oldPath, newPath)
return cmd.Run()
}
func runBuild(cmd *Command, args []string) {
curPath, err := os.Getwd()
if err != nil {

13
cmd/helper.go

@ -0,0 +1,13 @@
//
// +build !windows
package cmd
import (
"os/exec"
)
func makeLink(oldPath, newPath string) error {
cmd := exec.Command("ln", "-s", oldPath, newPath)
return cmd.Run()
}

10
cmd/helper_windows.go

@ -0,0 +1,10 @@
package cmd
import (
"os/exec"
)
func makeLink(oldPath, newPath string) error {
cmd := exec.Command("mklink", "/j", newPath, oldPath)
return cmd.Run()
}
Loading…
Cancel
Save