Fix bug with minecraft plugin upgrade: Previously if it failed the commmand it would empty the file

This commit is contained in:
batteredbunny 2024-11-16 17:08:02 +02:00
parent 7bdd317827
commit b978a8489f
3 changed files with 12 additions and 10 deletions

View file

@ -52,11 +52,13 @@
"simple-voice-chat" # https://modrinth.com/plugin/simple-voice-chat
"worldedit" # https://modrinth.com/plugin/worldedit
];
pluginFile = "games/minecraft/paper-vanilla-plugins.nix";
in
''
nix-minecraft-plugin-upgrade --loader paper --game-version 1.21.1 --project ${builtins.concatStringsSep " --project " plugins} > games/minecraft/paper-vanilla-plugins.nix
git add games/minecraft/paper-vanilla-plugins.nix
git commit games/minecraft/paper-vanilla-plugins.nix -m "Updated games/minecraft/paper-vanilla-plugins.nix"
nix-minecraft-plugin-upgrade --loader paper --game-version 1.21.1 --project ${builtins.concatStringsSep " --project " plugins} --file ${pluginFile}
git add ${pluginFile}
git commit ${pluginFile} -m "Updated ${pluginFile}"
'';
};

12
flake.lock generated
View file

@ -226,11 +226,11 @@
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1731548755,
"narHash": "sha256-kFg3S67OaYWI1SQ0tcmsPIC4PXtq7Av8AJcyf21ZxDE=",
"lastModified": 1731721802,
"narHash": "sha256-bdzCCvI3spAsAhWOt8NUrnyVSXI0DBTf7ZAGxJq05pk=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "e6f7090175ae5183d84adb6192f115d8f859beaa",
"rev": "b169b926e312ac0ea61367a191014a9d6e2114e8",
"type": "github"
},
"original": {
@ -246,11 +246,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1731704484,
"narHash": "sha256-4CZ9AtJz0kuKMOvzLSXQ45c63N9NuC5WHmgPU3Q1vXI=",
"lastModified": 1731768994,
"narHash": "sha256-cTrDtoKrJKXBd2H/itGlIMEZDeY5yLnvdq4saJEdPJE=",
"owner": "BatteredBunny",
"repo": "nix-minecraft-plugin-upgrade",
"rev": "f5080d5494567a214368946f03e0e3696962469c",
"rev": "c0f7054ad1443c67f6fbef10edddea42b0dba68d",
"type": "github"
},
"original": {

View file

@ -1,4 +1,4 @@
# auto generated with nix-minecraft-plugin-upgrade --loader paper --game-version 1.21.1 --project simple-voice-chat --project worldedit
# auto generated with nix-minecraft-plugin-upgrade --loader paper --game-version 1.21.1 --project simple-voice-chat --project worldedit --file games/minecraft/paper-vanilla-plugins.nix
{ pkgs, ... }: {
"plugins/voicechat-bukkit-2.5.25.jar" = pkgs.fetchurl { url = "https://cdn.modrinth.com/data/9eGKb6K1/versions/tA5pALYl/voicechat-bukkit-2.5.25.jar"; sha512 = "b01ac4d92ebe8d4ff848bdea8d4afcff9d600350d9ba86313e715499d4a339aafdf3d1b62261e4cfd7a397f4832c597c54e4b283c48c16e69cf622028d93a96b"; };
"plugins/worldedit-bukkit-7.3.8.jar" = pkgs.fetchurl { url = "https://cdn.modrinth.com/data/1u6JkXh5/versions/ecqqLKUO/worldedit-bukkit-7.3.8.jar"; sha512 = "ca8c25d1c2d894b7c3293617875abf23af1cb1c0a6a4e142ee514e7d06536a67d91664009ce8f54902c8f4fd05e32f8235f43cf52bfbd0a6c5622d6bef4f1c6e"; };