1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-29 01:44:39 +02:00
goreleaser/scripts/gen-nix-licenses.sh
Carlos Alexandro Becker dda1c708ae
feat(nix): validate licenses (#4497)
this will check if the license provided by the user is a valid one.

valid list of licenses is generated from nix's source code.

closes #4496
2023-12-26 08:37:44 -03:00

18 lines
409 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
{
echo "// AUTO-GENERATED. DO NOT EDIT."
echo
echo "package nix"
echo "var validLicenses = []string {"
curl -s https://raw.githubusercontent.com/NixOS/nixpkgs/master/lib/licenses.nix |
grep -E '.* = \{' |
grep -v default |
cut -f1 -d= |
awk '{print "\"" $1 "\","}'
echo -e "}"
} >./internal/pipe/nix/licenses.go
gofumpt -w ./internal/pipe/nix/licenses.go