#!/usr/bin/env bash
# Permission boundary for the deploy working tree. Caller defines DEPLOY.

deploy_tree_writable() {
  find -P "$DEPLOY" -path "$DEPLOY/.git" -prune -o \( -type d -o -type f \) \
    -exec chmod u+w {} +
}

deploy_tree_readonly() {
  find -P "$DEPLOY" -path "$DEPLOY/.git" -prune -o \( -type d -o -type f \) \
    -exec chmod a-w {} +
}
