Skip to content

Commit

Permalink
Merge pull request #511 from DefangLabs/edw-load-sample-create-dir
Browse files Browse the repository at this point in the history
Create sample dir before saving files
  • Loading branch information
lionello authored Jun 27, 2024
2 parents 41d1932 + 9e9194a commit 060f18a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pkg/cli/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func InitFromSamples(ctx context.Context, dir string, names []string) error {
subdir := ""
if len(names) > 1 {
subdir = name
if err := os.MkdirAll(filepath.Join(dir, subdir), 0755); err != nil {
return err
}
}
prefix := fmt.Sprintf("%s-%s/samples/%s/", repo, branch, name)
if base, ok := strings.CutPrefix(h.Name, prefix); ok && len(base) > 0 {
Expand Down

0 comments on commit 060f18a

Please sign in to comment.