Skip to content

Commit dc6e56d

Browse files
committed
Add support for extra files in ACUL scaffolding and update repo URLs
1 parent 73048b6 commit dc6e56d

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

internal/cli/acul_app_scaffolding.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ type Template struct {
3737
}
3838

3939
type Screens struct {
40-
ID string `json:"id"`
41-
Name string `json:"name"`
42-
Description string `json:"description"`
43-
Path string `json:"path"`
40+
ID string `json:"id"`
41+
Name string `json:"name"`
42+
Description string `json:"description"`
43+
Path string `json:"path"`
44+
ExtraFiles []string `json:"extra_files"`
4445
}
4546

4647
type Metadata struct {
@@ -111,7 +112,7 @@ func getLatestReleaseTag() (string, error) {
111112
}
112113

113114
// TODO: return tags[0].Name, nil.
114-
return "monorepo-sample", nil
115+
return "main", nil
115116
}
116117

117118
var (
@@ -348,7 +349,7 @@ func downloadAndUnzipSampleRepo() (string, error) {
348349
}
349350

350351
// TODO: repoURL := fmt.Sprintf("https://github.com/auth0-samples/auth0-acul-samples/archive/refs/tags/%s.zip", latestTag).
351-
repoURL := "https://github.com/auth0-samples/auth0-acul-samples/archive/refs/heads/monorepo-sample.zip"
352+
repoURL := "https://github.com/auth0-samples/auth0-acul-samples/archive/refs/heads/main.zip"
352353
tempZipFile, err := downloadFile(repoURL)
353354
if err != nil {
354355
return "", fmt.Errorf("error downloading sample repo: %w", err)
@@ -472,6 +473,11 @@ func copyProjectScreens(cli *cli, screens []Screens, selectedScreens []string, c
472473
if err := copyDir(srcPath, destPath); err != nil {
473474
return fmt.Errorf("error copying screen directory %s: %w", screen.Path, err)
474475
}
476+
477+
err = copyProjectTemplateFiles(cli, screen.ExtraFiles, chosenTemplate, tempUnzipDir, destDir)
478+
if err != nil {
479+
return err
480+
}
475481
}
476482

477483
return nil

internal/cli/acul_screen_scaffolding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func addScreensToProject(cli *cli, destDir, chosenTemplate string, selectedScree
171171
}
172172
defer os.RemoveAll(tempUnzipDir) // Clean up the entire temp directory.
173173

174-
var sourcePrefix = "auth0-acul-samples-monorepo-sample/" + chosenTemplate
174+
var sourcePrefix = "auth0-acul-samples-main/" + chosenTemplate
175175
var sourceRoot = filepath.Join(tempUnzipDir, sourcePrefix)
176176
var destRoot = destDir
177177

0 commit comments

Comments
 (0)