Skip to content

Commit 9ce89cd

Browse files
authored
Merge pull request #137 from go-flutter-desktop/fix/darwin-pkg
Fix darwin-pkg
2 parents 925dce1 + 443a5b8 commit 9ce89cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cmd/packaging/darwin-pkg.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var DarwinPkgTask = &packagingTask{
2222
packagingFunction: func(tmpPath, applicationName, packageName, executableName, version, release string) (string, error) {
2323
outputFileName := fmt.Sprintf("%s %s.pkg", applicationName, version)
2424

25-
payload, err := os.OpenFile(filepath.Join("flat", "base.pkg", "Payload"), os.O_RDWR|os.O_CREATE, 0755)
25+
payload, err := os.OpenFile(filepath.Join(tmpPath, "flat", "base.pkg", "Payload"), os.O_RDWR|os.O_CREATE, 0755)
2626
if err != nil {
2727
return "", err
2828
}
@@ -79,8 +79,12 @@ var DarwinPkgTask = &packagingTask{
7979
}
8080

8181
var files []string
82-
err = filepath.Walk(tmpPath, func(path string, info os.FileInfo, err error) error {
83-
files = append(files, path)
82+
err = filepath.Walk(filepath.Join(tmpPath, "flat"), func(path string, info os.FileInfo, err error) error {
83+
relativePath, err := filepath.Rel(filepath.Join(tmpPath, "flat"), path)
84+
if err != nil {
85+
return err
86+
}
87+
files = append(files, relativePath)
8488
return nil
8589
})
8690
if err != nil {

0 commit comments

Comments
 (0)