cmd/mkpkg: add name argument (#4372)

* shell.nix: rename goimports to gotools

Signed-off-by: Xe <xe@tailscale.com>

* cmd/mkpkg: allow specifying description and name in flag args

Signed-off-by: Xe <xe@tailscale.com>
pull/4373/head
Xe Iaso 3 years ago committed by GitHub
parent e014b4d970
commit be861797b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,6 +45,8 @@ func parseEmptyDirs(s string) []string {
func main() { func main() {
out := getopt.StringLong("out", 'o', "", "output file to write") out := getopt.StringLong("out", 'o', "", "output file to write")
name := getopt.StringLong("name", 'n', "tailscale", "package name")
description := getopt.StringLong("description", 'd', "The easiest, most secure, cross platform way to use WireGuard + oauth2 + 2FA/SSO", "package description")
goarch := getopt.StringLong("arch", 'a', "amd64", "GOARCH this package is for") goarch := getopt.StringLong("arch", 'a', "amd64", "GOARCH this package is for")
pkgType := getopt.StringLong("type", 't', "deb", "type of package to build (deb or rpm)") pkgType := getopt.StringLong("type", 't', "deb", "type of package to build (deb or rpm)")
files := getopt.StringLong("files", 'F', "", "comma-separated list of files in src:dst form") files := getopt.StringLong("files", 'F', "", "comma-separated list of files in src:dst form")
@ -68,12 +70,12 @@ func main() {
} }
emptyDirList := parseEmptyDirs(*emptyDirs) emptyDirList := parseEmptyDirs(*emptyDirs)
info := nfpm.WithDefaults(&nfpm.Info{ info := nfpm.WithDefaults(&nfpm.Info{
Name: "tailscale", Name: *name,
Arch: *goarch, Arch: *goarch,
Platform: "linux", Platform: "linux",
Version: *version, Version: *version,
Maintainer: "Tailscale Inc <info@tailscale.com>", Maintainer: "Tailscale Inc <info@tailscale.com>",
Description: "The easiest, most secure, cross platform way to use WireGuard + oauth2 + 2FA/SSO", Description: *description,
Homepage: "https://www.tailscale.com", Homepage: "https://www.tailscale.com",
License: "MIT", License: "MIT",
Overridables: nfpm.Overridables{ Overridables: nfpm.Overridables{

@ -15,10 +15,10 @@ pkgs.mkShell {
# This specifies the tools that are needed for people to get started with # This specifies the tools that are needed for people to get started with
# development. These tools include: # development. These tools include:
# - The Go compiler toolchain (and all additional tooling with it) # - The Go compiler toolchain (and all additional tooling with it)
# - goimports, a robust formatting tool for Go source code # - gotools for goimports, a robust formatting tool for Go source code
# - gopls, the language server for Go to increase editor integration # - gopls, the language server for Go to increase editor integration
# - git, the version control program (used in some scripts) # - git, the version control program (used in some scripts)
buildInputs = with pkgs; [ buildInputs = with pkgs; [
go goimports gopls git go gotools gopls git
]; ];
} }

Loading…
Cancel
Save