From 0f432025adfae0c85fdc72ac11015ad56920bae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 28 Apr 2021 16:10:50 +0200 Subject: [PATCH] feat(niveum-deploy): only deploy clean working directories this makes niveum-version always display accurate information --- shell.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 921df98..b525a1a 100644 --- a/shell.nix +++ b/shell.nix @@ -50,7 +50,12 @@ in pkgs.mkShell { eval "$(${pkgs.nix}/bin/nix-build --no-out-link "${toString ./.}/deploy.nix" -A "$1")" ''; in pkgs.writers.writeDashBin "niveum-deploy" '' - ${pkgs.parallel}/bin/parallel --line-buffer --tagstring '{}' -q ${deployCommand} '{1}' ::: "$@" + if [ -z "$(${pkgs.git}/bin/git status --porcelain)" ]; then + ${pkgs.parallel}/bin/parallel --line-buffer --tagstring '{}' -q ${deployCommand} '{1}' ::: "$@" + else + echo Working directory is dirty. Not deploying. + exit 1 + fi '') (pkgs.writers.writeDashBin "niveum-status" ''