Skip to content

Commit

Permalink
fix: Use config file REL path to tmp
Browse files Browse the repository at this point in the history
This fixes the issue where /tmp/template-xxxx/template/waku[.ext] is
passed into the ignore rules, causing it to ignore everything and only a
LICENSE file is written. This patch just converts the path to the
relative path to the cloned dir in tmp. In other words the above turns
into template/waku[.ext].

Signed-off-by: AlexNg <contact@ngjx.org>
  • Loading branch information
caffeine-addictt committed Oct 16, 2024
1 parent 80a8702 commit bb3fcf7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/commands/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,19 @@ var NewCmd = &cobra.Command{
}
log.Debugf("resolved file paths to: %v\n", paths)

// get config rel path
configRelPath, err := filepath.Rel(tmpDir, configFilePath)
if err != nil {
return errors.ToWakuError(err)
}
log.Debugf("resolved config rel path to: %s\n", configRelPath)

// Handle ignores
log.Infoln("applying ignore rules...")
ignoreRules := types.NewSet(
".git/",
"LICENSE*",
configFilePath,
configRelPath,
)
if tmpl.Ignore != nil {
ignoreRules.Union(types.Set[string](*tmpl.Ignore))
Expand Down

0 comments on commit bb3fcf7

Please sign in to comment.