-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert-code.sh
More file actions
executable file
·35 lines (27 loc) · 822 Bytes
/
insert-code.sh
File metadata and controls
executable file
·35 lines (27 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
source tt-lib.sh
source config.sh
langName="$(config_get langName)"
txtfile=$(readlink -f -n "$1")
folder=${txtfile%.*}
txtfile=$(basename "$txtfile")
txtfilename=${txtfile%.*}
#echo $folder
abfrage=$(yad --title="Insert code?" --text="Necessary Informations:" \
--form --width 500 --separator="~" --item-separator="," \
--field="Filename" \
--field="Shortname for language":CBE \
--field="Add to existing code":CB \
"" "$langName" ",yes")
if [ ! $? -eq 1 ];
then
mkdir -p "$folder"
File=$(echo $abfrage | cut -s -d "~" -f 1)
langname=$(echo $abfrage | cut -s -d "~" -f 2)
add=$(echo $abfrage | cut -s -d "~" -f 3)
File=$(cleanName "$File")
extens="$(get-extens ${langname})"
Filename="$File"
File="$File"."${extens}"
template-code "." "${Filename}.${extens}" "${txtfilename}" "$add"
fi