mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-24 22:00:36 +08:00
17 lines
372 B
Bash
Executable File
17 lines
372 B
Bash
Executable File
#! /usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
FILE=$1
|
|
|
|
while ! typos "$FILE"; do \
|
|
exec < /dev/tty; \
|
|
echo ""; \
|
|
printf "%sTypos found.%s (e)dit, (c)ontinue, or (a)bort? [E/c/a] " "${WARN}" "${NORMAL}"; \
|
|
read -r response; \
|
|
case "$response" in \
|
|
[cC]*) exit 0 ;; \
|
|
[aA]*) exit 1 ;; \
|
|
*) ${EDITOR:-nano} "$FILE" ;; \
|
|
esac; \
|
|
done
|