Skip to content

Commit

Permalink
export functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bsamadi authored Oct 10, 2021
1 parent cdd8e96 commit e0e8784
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions define-text2talk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,36 @@
# SPDX-License-Identifier: Apache 2.0

function text2pdf {
echo pandoc $@
docker run -it --rm -u `id -u`:`id -g` -v $PWD:/work -w /work pandoc/latex "$@"
ARGS=$@
echo pandoc $ARGS
docker run \
-h text2talk \
--detach \
--name text2talk \
--env COLORFGBG \
--env EMAIL \
--env TERM \
--env USER=${USER} \
--env GROUP=${USER} \
--env USER_ID=`id -u ${USER}` \
--env GROUP_ID=`getent group ${USER} | awk -F: '{printf $3}'` \
-v ${PWD}:/workspace \
--env DISPLAY \
--env VIDEO_GROUP_ID=`getent group video | awk -F: '{printf $3}'` \
-v /home/${USER}/.aws:/home/${USER}/.aws:ro \
--cap-add=SYS_PTRACE \
--net=host \
--privileged \
--add-host text2talk:127.0.0.1 \
nubonetics/text2talk:latest >> /dev/null
sleep 1
docker exec -it --env COLORFGBG --env TERM -u ${USER} text2talk /bin/bash -lc "cd /workspace; pandoc $ARGS"
docker stop text2talk >> /dev/null
docker rm text2talk >> /dev/null
}

export -f text2pdf

function pdf2talk {
ARGS=$@
echo pdf2video $ARGS
Expand Down Expand Up @@ -36,3 +62,5 @@ docker exec -it --env COLORFGBG --env TERM -u ${USER} text2talk /bin/bash -lc "c
docker stop text2talk >> /dev/null
docker rm text2talk >> /dev/null
}

export -f pdf2talk

0 comments on commit e0e8784

Please sign in to comment.