goreleaser / nfpm

nFPM is Not FPM - a simple deb, rpm, apk, ipk, and arch linux packager written in Go
https://nfpm.goreleaser.com/
MIT License
2.14k stars 156 forks source link

feat: env expand contents #721

Closed caarlos0 closed 11 months ago

caarlos0 commented 11 months ago

closes #719

cloudflare-pages[bot] commented 11 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 33f1b30
Status: ✅  Deploy successful!
Preview URL: https://219da237.nfpm.pages.dev
Branch Preview URL: https://contents-env-expand.nfpm.pages.dev

View logs

codecov[bot] commented 11 months ago

Codecov Report

Merging #721 (33f1b30) into main (32c34dd) will increase coverage by 0.10%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #721      +/-   ##
==========================================
+ Coverage   75.08%   75.18%   +0.10%     
==========================================
  Files          10       10              
  Lines        2412     2422      +10     
==========================================
+ Hits         1811     1821      +10     
  Misses        425      425              
  Partials      176      176              
Files Coverage Δ
files/files.go 76.64% <ø> (ø)
nfpm.go 85.65% <100.00%> (+0.59%) :arrow_up:
djgilcrease commented 11 months ago

Careful with this as we have rejected this in the past because $ is a valid path character. So we need tests for that and need to document that if a $ is in the path it needs to be escaped.

AlekSi commented 11 months ago

Another option is to opt-in into expanding:

contents:
- src: '${NAME}_${ARCH}'
  dst: /usr/bin/${NAME}
  expand: true
djgilcrease commented 11 months ago

Another option is to opt-in into expanding:

I like this solution, that way it is explicit that the user knows it will expand env vars

caarlos0 commented 11 months ago

pushed