Publish quilt script + template
This commit is contained in:
parent
f0ef00d02c
commit
1878a61752
|
@ -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."
|
|
@ -0,0 +1,8 @@
|
|||
+------------------------------+
|
||||
|### YYYY-MM-DD TT:TT|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
+------------------------------+
|
Loading…
Reference in New Issue