pulumi/pkg/engine/pack_verify.go
Matt Ellis a6eabdc34b Move a bunch of code around
Move most of the guts of `lumi` into the newly created `engine`
package.
2017-08-24 18:00:46 -07:00

19 lines
547 B
Go

package engine
import "github.com/pkg/errors"
func PackVerify(pkgarg string) error {
// Prepare the compiler info and, provided it succeeds, perform the verification.
if comp, pkg := prepareCompiler(pkgarg); comp != nil {
// Now perform the compilation and extract the heap snapshot.
if pkg == nil && !comp.Verify() {
return errors.New("verification failed")
} else if pkg != nil && !comp.VerifyPackage(pkg) {
return errors.New("verification failed")
}
return nil
}
return errors.New("could not create prepare compiler")
}