mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-23 07:21:28 +00:00
revel/revel#389 run cmd become more robust
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"archive/tar"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -167,3 +168,9 @@ func empty(dirname string) bool {
|
||||
results, _ := dir.Readdir(1)
|
||||
return len(results) == 0
|
||||
}
|
||||
|
||||
func importPathFromCurrentDir() string {
|
||||
pwd, _ := os.Getwd()
|
||||
importPath, _ := filepath.Rel(filepath.Join(build.Default.GOPATH, "src"), pwd)
|
||||
return filepath.ToSlash(importPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user