diff options
author | EuAndreh <eu@euandre.org> | 2019-06-02 12:19:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-06-02 12:21:47 -0300 |
commit | 323892f73860f254242a7000fb336015798deff7 (patch) | |
tree | 7d71e6d5d8d212408d86aa95c6a48b0e90a0c679 | |
parent | Use ~/tmp/backup/ for backing up ad-hoc data (diff) | |
download | dotfiles-323892f73860f254242a7000fb336015798deff7.tar.gz dotfiles-323892f73860f254242a7000fb336015798deff7.tar.xz |
Parameterize the overwriting of docs publishing
-rw-r--r-- | default.nix | 4 | ||||
-rw-r--r-- | utils.nix | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/default.nix b/default.nix index fe8faae..dc9418a 100644 --- a/default.nix +++ b/default.nix @@ -35,5 +35,7 @@ in rec { (utils.fixme [ "default.nix" "utils.nix" ]) subtasks.uniqueFeeds ]; - publishScript = utils.overwritingPublishScript subtasks.docs; + publishScript = utils.overwritingPublishScript { + docsDerivation = subtasks.docs; + }; } @@ -85,11 +85,11 @@ in rec { touch $out ''; }); - overwritingPublishScript = docsDerivation: + overwritingPublishScript = { docsDerivation, overwrite ? true }: pkgs.writeShellScriptBin "publish.sh" '' set -euo pipefail OUT_DOCS="${docsDerivation}" - ${pkgs.openssh}/bin/ssh -o StrictHostKeyChecking=no "$SERVER_URL" rm -rf "$DOCS_SERVER_PATH/*" + ${if overwrite then "# " else ""}${pkgs.openssh}/bin/ssh -o StrictHostKeyChecking=no "$SERVER_URL" rm -rf "$DOCS_SERVER_PATH/*" ${pkgs.rsync}/bin/rsync -avzP \ --rsh="ssh -o StrictHostKeyChecking=no" \ "$OUT_DOCS/" \ |