Skip to content

Commit 8d19c3b

Browse files
committed
Include full src,build in zip
1 parent d86ac8e commit 8d19c3b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd_publish.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"io"
99
"os"
1010
"path/filepath"
11+
"strings"
1112
"time"
1213
)
1314

@@ -33,8 +34,8 @@ var publishCmd = &cobra.Command{
3334
zipWriter := zip.NewWriter(zipPipeWriter)
3435

3536
selected := make(map[string]bool)
36-
optionalFiles := []string{"README.md", "package-lock.json"}
37-
requiredFiles := []string{"package.json", "build/index.js"}
37+
optionalFiles := []string{"package-lock.json"}
38+
requiredFiles := []string{"README.md", "package.json", "build/index.js", "src/index.ts"}
3839
for _, name := range optionalFiles {
3940
selected[filepath.ToSlash(filepath.Clean(name))] = true
4041
}
@@ -72,7 +73,8 @@ var publishCmd = &cobra.Command{
7273

7374
relPath = filepath.ToSlash(filepath.Clean(relPath)) // Normalize for zip entries
7475

75-
if !selected[relPath] {
76+
// Skip non-desired files or files not in src/ or build/ (we want those)
77+
if !strings.HasPrefix(relPath, "src/") && !strings.HasPrefix(relPath, "build/") && !selected[relPath] {
7678
return nil
7779
}
7880

0 commit comments

Comments
 (0)