Publish quilt script + template

This commit is contained in:
Jomar Milan 2023-10-06 13:29:49 -07:00
parent f0ef00d02c
commit 1878a61752
2 changed files with 36 additions and 0 deletions

28
quilt Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
export GUM_INPUT_PROMPT_FOREGROUND="#04b575"
REL=$(gum input --prompt "Insert this tile in relation to which space? " --placeholder 1)
echo "Insert in which direction from this space?"
DIR=$(gum choose "Left" "Right" "Up" "Down")
if [[ $DIR == "Left" ]]; then
RDIR=W
elif [[ $DIR == "Right" ]]; then
RDIR=E
elif [[ $DIR == "Up" ]]; then
RDIR=N
elif [[ $DIR == "Down" ]]; then
RDIR=S
fi
QC=$(head -n -1 $1 | tail -n 4 | awk 'BEGIN{FS=""; OFS=FS} {$32=""; $1=""; print}' | tr -d '\n')
RAW="$REL$RDIR$QC"
echo "Quilt Tile:"
cat $1
echo "Raw:"
echo "$REL$RDIR$QC"
gum confirm "Submit this tile to the quilt, to the $DIR of $REL?" && echo "$REL$RDIR$QC" > /home/lab6/quilt || echo "Operation aborted."

8
quilt-temp Normal file
View File

@ -0,0 +1,8 @@
+------------------------------+
|### YYYY-MM-DD TT:TT|
| |
| |
| |
| |
| |
+------------------------------+