Fudge

infrastructure / pre-commit

Commits | bovarysme Add instructions to upgrade OpenBSD in README.md Committed on Oct 18, 2020

325 B | Download

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/bin/bash

set -o errexit
set -o nounset

BASEDIR=$(dirname "$GIT_DIR")

fmt () {
    files=$(terraform fmt "$BASEDIR/terraform")
    if test -n "$files"; then
        echo "[pre-commit] Formatted Terraform configuration files"
        for file in $files; do
            git add "$BASEDIR/$file"
        done
    fi
}

fmt