scripts: reformat

This commit is contained in:
Harsh Shandilya 2024-01-19 17:26:54 +05:30
parent c5117e8669
commit 8340228637
3 changed files with 5 additions and 5 deletions

View file

@ -6,13 +6,13 @@ INPUT_FILE="${1:-}"
OUTPUT_FILE="${2:-}"
AGE_KEY="${3:-}"
if ! command -v age 1>/dev/null; then
if ! command -v age 1> /dev/null; then
echo "age not installed"
exit 1
fi
if [[ -n $AGE_KEY && -n $INPUT_FILE && -n $OUTPUT_FILE ]]; then
age --encrypt -r "$(echo "${AGE_KEY}" | age-keygen -y)" -o "${OUTPUT_FILE}" <"${INPUT_FILE}"
age --encrypt -r "$(echo "${AGE_KEY}" | age-keygen -y)" -o "${OUTPUT_FILE}" < "${INPUT_FILE}"
else
echo "Usage: ./encrypt-secret.sh <input file> <output file> <encryption key>"
fi