Handle multiple demos for the same map cleanly instead of needing manual file management for it.
This commit is contained in:
parent
79399a5d82
commit
978cddca61
1 changed files with 5 additions and 4 deletions
9
dcc
9
dcc
|
@ -13,6 +13,8 @@ DEMOPATH="${HOME}/doom/demos/${PWAD}"
|
||||||
VIDPATH="${HOME}/doom/fabricate/${PWAD}"
|
VIDPATH="${HOME}/doom/fabricate/${PWAD}"
|
||||||
MAPSTR="$(tr ' ' '-' <<< "${MAP}")"
|
MAPSTR="$(tr ' ' '-' <<< "${MAP}")"
|
||||||
MAPFILE="${PWAD}_map${MAPSTR}"
|
MAPFILE="${PWAD}_map${MAPSTR}"
|
||||||
|
DEMONAME="${MAPFILE}.lmp"
|
||||||
|
DEMO_IN="$(find "${DEMOPATH}" -name "${MAPFILE}"'*' | tail -2 | head -1)"
|
||||||
|
|
||||||
if ! [[ -e "${PWADPATH}" ]]; then
|
if ! [[ -e "${PWADPATH}" ]]; then
|
||||||
echo "PWAD ${PWAD} not found." >&2
|
echo "PWAD ${PWAD} not found." >&2
|
||||||
|
@ -28,10 +30,10 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
"fabricate")
|
"fabricate")
|
||||||
mkdir -p "${VIDPATH}"
|
mkdir -p "${VIDPATH}"
|
||||||
COMMAND=("-timedemo" "${DEMOPATH}/${PWAD}_map${MAPSTR}.lmp" "-viddump" "${VIDPATH}/${PWAD}_map${MAPSTR}.mp4")
|
COMMAND=("-timedemo" "${DEMO_IN}" "-viddump" "${VIDPATH}/${PWAD}_map${MAPSTR}.mp4")
|
||||||
;;
|
;;
|
||||||
"put")
|
"put")
|
||||||
s3cmd put -P --content-type=binary/octet-stream "${DEMOPATH}/${MAPFILE}.lmp" "s3://yrriban/doom/${MAPFILE}.lmp"
|
s3cmd put -P --content-type=binary/octet-stream "${DEMO_IN}" "s3://yrriban/doom/${MAPFILE}.lmp"
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
"pb")
|
"pb")
|
||||||
|
@ -101,8 +103,7 @@ OPTIONS=()
|
||||||
if [[ -e "${PWADPATH}/options" ]]; then
|
if [[ -e "${PWADPATH}/options" ]]; then
|
||||||
OPTIONS=("-assign" "$(< "${PWADPATH}/options")")
|
OPTIONS=("-assign" "$(< "${PWADPATH}/options")")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: properly split MAP into an array in case this is a UDoom wad.
|
# TODO: properly split MAP into an array in case this is a UDoom wad.
|
||||||
dsda-doom \
|
/home/tynan/src/dsda-doom/prboom2/cmake/dsda-doom \
|
||||||
-skill 4 -warp ${MAP} \
|
-skill 4 -warp ${MAP} \
|
||||||
"${IWAD[@]}" "${WADS[@]}" "${DEH[@]}" "${COMPLEVEL[@]}" "${OPTIONS[@]}" "${COMMAND[@]}"
|
"${IWAD[@]}" "${WADS[@]}" "${DEH[@]}" "${COMPLEVEL[@]}" "${OPTIONS[@]}" "${COMMAND[@]}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue