
* build/install * all branches * e2e test * goc binary PATH add checkout code add +x test github action test for github action test for github actions test for github actions test for github actions fix ci fix fix temp path error * go1.11 1.10 not support go env command fix * fix build dir error for go 1.11/1.12 mod project * e2e test test test fix yaml syntax error fix fix fix * fix env error fix fix * add unit test * add unit test coverage report update update * add license
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
/*
|
|
Copyright 2020 Qiniu Cloud (七牛云)
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package build
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/otiai10/copy"
|
|
"github.com/qiniu/goc/pkg/cover"
|
|
)
|
|
|
|
func cpGoModulesProject(tmpBuildDir string, pkgs map[string]*cover.Package) {
|
|
for _, v := range pkgs {
|
|
if v.Name == "main" {
|
|
dst := tmpBuildDir
|
|
src := v.Module.Dir
|
|
|
|
if err := copy.Copy(src, dst); err != nil {
|
|
log.Printf("Failed to Copy the folder from %v to %v, the error is: %v ", src, dst, err)
|
|
}
|
|
break
|
|
} else {
|
|
continue
|
|
}
|
|
}
|
|
}
|