Skip to content

Commit

Permalink
fix: licence script get the correct MIT licence
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Mar 17, 2024
1 parent abde21e commit 5907a1b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions home/isabel/programs/scripts/licence.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{pkgs, ...}: ''
CHOOSE=$(${pkgs.gum}/bin/gum choose "cc by-nc-sa 4.0" "MIT" "GPLv3")
{
lib,
pkgs,
...
}: let
inherit (lib) getExe;
in ''
CHOOSE=$(${getExe pkgs.gum} choose "cc by-nc-sa 4.0" "MIT" "GPLv3")
if [ "$CHOOSE" = "cc by-nc-sa 4.0" ]; then
LICENSE="https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt"
elif [ "$CHOOSE" = "MIT" ]; then
LICENSE="https://opensource.org/licenses/MIT"
LICENSE="https://gist.githubusercontent.com/isabelroses/fa6f71651be564ada535bb56dec1e13b/raw/c766f746e94771d92bea73db881a567215b5fe77/MIT%2520License"
elif [ "$CHOOSE" = "GPLv3" ]; then
LICENSE="https://www.gnu.org/licenses/gpl-3.0.txt"
else
echo "You chose nothing"
exit 1
fi
${pkgs.curl}/bin/curl -o LICENSE $LICENSE
${getExe pkgs.curl} -o LICENSE $LICENSE
''

0 comments on commit 5907a1b

Please sign in to comment.