-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: feat: Use conventional file names by default #157
WIP: feat: Use conventional file names by default #157
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/goreleaser/nfpm/hrdk1607s |
a8fd6b4
to
999c9d3
Compare
IMHO its OK.
I think we can do it in another one, since this one is pretty much done...
no problem, CI passed :) although there are some missing coverage, but we can handle that later.. |
This is already included in this pull request because I had to change this part due to the call to A: Before this pull request return pkg.Package(info, f) B: Currently in this pull request err = pkg.Package(info, f)
_ = f.Close()
if err != nil {
os.Remove(target)
return err
}
fmt.Printf("created package: %s\n", target)
return nil C: If I remove the file removal again: err = pkg.Package(info, f)
if err != nil {
return err
}
fmt.Printf("created package: %s\n", target)
return nil What do you prefer for this pull request? |
Let's leave as is then. Can I merge it? |
As far as I'm concerned, sure. |
awesome, thanks for the PR :) |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull request changes the behaviour of the
--target
CLI option to produce conventional file for the respective packages by default. Conventional file names are for example package_version_architecture.package-type for Debian packages and name-version-release.architecture.rpm for RPMs. Consider the following cases:--target
is blank or omitted: Create a package with a conventional file name in current directory--target
is a directory: Create a package with a conventional file name in the directory--target
is a file name: Use this file nameWhy?
Because at the moment,
nfpm
allows users to omit--target
and uses the very weird default/tmp/foo.deb
in this case. A default value should cover the most common use cases and creating the file/tmp/foo.deb
would be a very weird use case and is just plain wrong for RPM files.At the moment, there are a few issues:
nfpm.go
(where I initially put it) because it needs access to the architecture translation and it has to be ensured that every future architecture provides such a name.doPackage()
because the success message now has to be printed there. At the same time, I changed the behaviour to remove the empty package file if packaging fails. Is it okay to also include that in this pull request?