TmpFolderName make public
This commit is contained in:
parent
5f4f5c5bd7
commit
9aeb1da8f8
@ -43,11 +43,11 @@ func (b *Build) readProjectMetaInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get tmp folder name
|
// get tmp folder name
|
||||||
config.GocConfig.TmpModProjectDir = filepath.Join(os.TempDir(), tmpFolderName(config.GocConfig.CurModProjectDir))
|
config.GocConfig.TmpModProjectDir = filepath.Join(os.TempDir(), TmpFolderName(config.GocConfig.CurModProjectDir))
|
||||||
// get working dir in the corresponding tmp dir
|
// get working dir in the corresponding tmp dir
|
||||||
config.GocConfig.TmpWd = filepath.Join(config.GocConfig.TmpModProjectDir, config.GocConfig.CurWd[len(config.GocConfig.CurModProjectDir):])
|
config.GocConfig.TmpWd = filepath.Join(config.GocConfig.TmpModProjectDir, config.GocConfig.CurWd[len(config.GocConfig.CurModProjectDir):])
|
||||||
// get GlobalCoverVarImportPath
|
// get GlobalCoverVarImportPath
|
||||||
config.GocConfig.GlobalCoverVarImportPath = path.Join(config.GocConfig.ImportPath, tmpFolderName(config.GocConfig.CurModProjectDir))
|
config.GocConfig.GlobalCoverVarImportPath = path.Join(config.GocConfig.ImportPath, TmpFolderName(config.GocConfig.CurModProjectDir))
|
||||||
log.Donef("project meta information parsed")
|
log.Donef("project meta information parsed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ func (b *Build) copyProjectToTmp() {
|
|||||||
log.StopWait()
|
log.StopWait()
|
||||||
}
|
}
|
||||||
|
|
||||||
// tmpFolderName generates a directory name according to the path
|
// TmpFolderName generates a directory name according to the path
|
||||||
func tmpFolderName(path string) string {
|
func TmpFolderName(path string) string {
|
||||||
sum := sha256.Sum256([]byte(path))
|
sum := sha256.Sum256([]byte(path))
|
||||||
h := fmt.Sprintf("%x", sum[:6])
|
h := fmt.Sprintf("%x", sum[:6])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user