Added ticket section

This commit is contained in:
Tristan Ancelet 2023-12-08 14:01:49 -06:00
parent 29c236affa
commit c969e00939
4 changed files with 33 additions and 2 deletions

View File

@ -7,7 +7,8 @@ export SCRIPT_DIR=$PROJ_DIR/scripts
export FILES_DIR=$PROJ_DIR/files export FILES_DIR=$PROJ_DIR/files
export SUBJECTS_DIR=$PROJ_DIR/subjects export SUBJECTS_DIR=$PROJ_DIR/subjects
export UTILS_DIR=$SCRIPT_DIR/utils export UTILS_DIR=$SCRIPT_DIR/utils
export SITE_NAV='[[/index.wiki|Index]] [[/full_index.wiki|Full Index]] [[/tasks.wiki|Tasks]] [[/how-to.wiki|How-To]] [[/subjects.wiki|Subjects]]' export TICKET_DIR=$PROJ_DIR/ticket
export SITE_NAV='[[/index.wiki|Index]] [[/full_index.wiki|Full Index]] [[/tasks.wiki|Tasks]] [[/how-to.wiki|How-To]] [[/subjects.wiki|Subjects]] [[/tickets.wiki|Tickets]]'
function import () { function import () {
local SCRIPT_NAME="${1:?"import : script name not provided"}" local SCRIPT_NAME="${1:?"import : script name not provided"}"

View File

@ -0,0 +1 @@
../update_tickets.sh

View File

@ -1,9 +1,11 @@
#!/opt/homebrew/bin/bash #!/opt/homebrew/bin/bash
cd `dirname $0`
[[ -f config.sh ]] && [[ $CONFIG -ne 1 ]] && . config.sh [[ -f config.sh ]] && [[ $CONFIG -ne 1 ]] && . config.sh
cd $PROJ_DIR cd $PROJ_DIR
for script in $SCRIPT_DIR/enabled/**; do for script in $SCRIPT_DIR/enabled/*; do
[[ -x $script ]] && $script [[ -x $script ]] && $script
done done

27
scripts/update_tickets.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/local/bin/bash
[[ $CONFIG -ne 1 ]] && {
cd `dirname $0`
[[ -f config.sh ]] && . config.sh
}
cat > $PROJ_DIR/tickets.wiki <<EOF
%title Tickets
----------------------
$SITE_NAV
----------------------
= Tickets =
-----------
`
for file in $TICKET_DIR/*; do
FILENAME="${file/*\/}"
FILENAME="${FILENAME/\.*}"
echo "- [[/ticket/$FILENAME|${FILENAME^^}]]"
done
`
EOF