Merge pull request #30 from nlepage/fix/out_pkged

fix embed not working with -o
This commit is contained in:
Mark Bates 2019-11-11 14:55:39 -08:00 committed by GitHub
commit f25d3ebfe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ func (e *packCmd) Exec(args []string) error {
return err
}
if err := Package(fp, decls); err != nil {
if err := Package(info, fp, decls); err != nil {
return err
}
@ -123,7 +123,7 @@ func (e *packCmd) Flags() *flag.FlagSet {
return e.FlagSet
}
func Package(out string, decls parser.Decls) error {
func Package(info here.Info, out string, decls parser.Decls) error {
os.RemoveAll(out)
defer func() {
if err := recover(); err != nil {
@ -146,7 +146,7 @@ func Package(out string, decls parser.Decls) error {
fmt.Fprintf(f, "import \"github.com/markbates/pkger/pkging/mem\"\n\n")
fmt.Fprintf(f, "\nvar _ = pkger.Apply(mem.UnmarshalEmbed([]byte(`")
if err := pkgutil.Stuff(f, c, decls); err != nil {
if err := pkgutil.Stuff(f, info, decls); err != nil {
return err
}