Commit dce2a28b authored by nimrod's avatar nimrod
Browse files

pre-commit: Address some warnings.

parent 4a789af0
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ repos:
    hooks:
      - id: codespell
        args:
          - '-L=doas,fo'
          - '-L=doas,fo,anull'

  - repo: https://github.com/Yelp/detect-secrets.git
    rev: v1.5.0
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ then
    usage
elif [ ! -d "$1" ]
then
    echo "Destinaton $1 not found or is not a directory." >&2
    echo "Destination $1 not found or is not a directory." >&2
    exit 1
elif [ "$(id -u)" -ne 0 ]
then
@@ -70,7 +70,7 @@ for name in $(docker volume ls --filter label=snapshot=true --format '{{ .Name }
do
    echo "Backing up $name."
    mountpoint="$(docker volume inspect --format '{{ .Mountpoint }}' "$name")"
    src="$snapshot/${mountpoint#$root_volume/}"
    src="$snapshot/${mountpoint#"$root_volume"/}"
    # shellcheck disable=SC2115
    [ ! -e "$dest/$name" ] || rm -rf "$dest/$name"
    cp --archive --force --reflink=always "$src" "$dest/$name"
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ volume="$(root_subvolume /var/backups)"
snapshot="$(mktemp --dry-run "--tmpdir=$volume")"
btrfs subvolume snapshot -r "$volume" "$snapshot"
source="/var/backups"
source="${snapshot}${source#$volume}/"
source="${snapshot}${source#"$volume"}/"

sync --file-system /var/backups
rsync --archive \