Skip to content

Commit

Permalink
fix: Only license is templated (#167)
Browse files Browse the repository at this point in the history
* refactor: Improve logging

* fix: Use config file REL path to tmp

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 <[email protected]>
  • Loading branch information
caffeine-addictt authored Oct 16, 2024
2 parents 4cd67a6 + 4bb3463 commit fb35c81
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
15 changes: 12 additions & 3 deletions cmd/commands/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,26 @@ var NewCmd = &cobra.Command{
}

// Get file paths
log.Infoln("Getting file paths...")
log.Infoln("getting file paths...")
paths, err := utils.WalkDirRecursive(rootDir)
if err != nil {
return errors.ToWakuError(err)
}
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 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 All @@ -207,6 +215,7 @@ var NewCmd = &cobra.Command{

// account for template.json having a '!.git/'
ignoreRules = template.ResolveIncludes(ignoreRules, types.NewSet(".git/", "LICENSE"))
log.Debugf("ignore rules applied: %v\n", ignoreRules)
ignoredPaths := template.ResolveIncludes(types.NewSet(paths...), ignoreRules)

log.Debugf("resolved files to write: %v\n", ignoredPaths)
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version

// The current app version
const Version = "0.7.2"
const Version = "0.7.3"
4 changes: 2 additions & 2 deletions www/docs/configuration/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ for better editor support.
https://waku.ngjx.org/static/schema.json
```

Or you can pin a specific version like `v0.7.2`:
Or you can pin a specific version like `v0.7.3`:

```text
https://raw.githubusercontent.com/caffeine-addictt/waku/v0.7.2/www/docs/static/schema.json
https://raw.githubusercontent.com/caffeine-addictt/waku/v0.7.3/www/docs/static/schema.json
```

Simply add the `$schema` property to your `configuration` file:
Expand Down
10 changes: 5 additions & 5 deletions www/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ All artifacts are checksummed, and the checksum file is signed with [cosign][].
and `checksums.txt.sig` files from the [releases][] page.

```sh
curl -O 'https://github.com/caffeine-addictt/waku/releases/download/v0.7.2/checksums.txt'
curl -O 'https://github.com/caffeine-addictt/waku/releases/download/v0.7.3/checksums.txt'
```

1. Verify checksums signature:

```bash
cosign verify-blob \
--certificate-identity 'https://github.com/caffeine-addictt/waku/.github/workflows/release.yml@refs/tags/v0.7.2' \
--certificate-identity 'https://github.com/caffeine-addictt/waku/.github/workflows/release.yml@refs/tags/v0.7.3' \
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
--cert 'https://github.com/caffeine-addictt/waku/releases/download/v0.7.2/checksums.txt.pem' \
--signature 'https://github.com/caffeine-addictt/waku/releases/download/v0.7.2/checksums.txt.sig' \
--cert 'https://github.com/caffeine-addictt/waku/releases/download/v0.7.3/checksums.txt.pem' \
--signature 'https://github.com/caffeine-addictt/waku/releases/download/v0.7.3/checksums.txt.sig' \
./checksums.txt
```

Expand All @@ -130,7 +130,7 @@ Verify the signature:

```sh
cosign verify \
--certificate-identity 'https://github.com/caffeine-addictt/waku/.github/workflows/release.yml@refs/tags/v0.7.2' \
--certificate-identity 'https://github.com/caffeine-addictt/waku/.github/workflows/release.yml@refs/tags/v0.7.3' \
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
caffeinec/waku
```
Expand Down

0 comments on commit fb35c81

Please sign in to comment.