From 3d05ac9a93bf9235eea090e6b9ff0de268d62004 Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 24 Feb 2025 21:49:25 +0300 Subject: [PATCH] huggingface login confition --- modules/graphical-interface.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/graphical-interface.nix b/modules/graphical-interface.nix index 397486e..4d5733b 100644 --- a/modules/graphical-interface.nix +++ b/modules/graphical-interface.nix @@ -57,11 +57,17 @@ pkgs.zip ]; text = '' + # check if logged in to huggingface + # hugingface-cli whoami == "Not logged in" means not logged in + if [ "$(huggingface-cli whoami)" == "Not logged in" ]; then + echo "Please log in to huggingface" + exit 1 + fi + cd ~/.local/share timestamp=$(date +%Y-%m-%d_%H-%M) echo "$timestamp" zip -r "Terraria_$timestamp.zip" Terraria/ - echo huggingface-cli whoami huggingface-cli upload --repo-type dataset osbm/terraria-backups "Terraria_$timestamp.zip" "Terraria_$timestamp.zip" ''; })