Files
dirmd/docs/ADDING_DIRMD_TO_GIT_POST_COMMIT_HOOKS.md
T

752 B

Automating sending files to proton drive on commits

If you add this to any repos, and have dirmd in path and logged in on proton drive cli, then after each commit the newest code is pushed to proton drive, as vertical slices. If you do not want vertical slices of the code omit --vertical-slices. Also check out the other flags of dirmd if required.

repos-root/.git/hooks/post-commit

create this file

#!/bin/bash

set -euo pipefail

if ! command -v dirmd &>/dev/null; then
    exit 0
fi

REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(basename "$REPO_ROOT")

dirmd -o "/tmp/${REPO_NAME}_new" "$REPO_ROOT" -f --vertical-slices --proton-drive

and then make it executable with something like chmod +x .git/hooks/post-commit