From 156b2ff45468bd4cf1155a37bef58431ec87495f Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sun, 13 Oct 2019 20:32:07 +0200 Subject: [PATCH] Add a "master" script --- games/save.game | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 games/save.game diff --git a/games/save.game b/games/save.game new file mode 100755 index 0000000..472f9c1 --- /dev/null +++ b/games/save.game @@ -0,0 +1,31 @@ +#!/bin/sh + +# Purpose {{{ +## Run all other save.game.* scripts. +# }}} + +# Vars {{{ +script_wd=$(dirname -- "${0}") + +## List of scripts +home_script="save.game.home" +steam_script="save.game.steam" +xdg_script="save.game.xdg" + +# }}} + +# For all scripts, try to run +for script in "${home_script}" "${steam_script}" "${xdg_script}"; do + + ## If the script doesn't exist + if [ ! -f "${script_wd}/${script}" ]; then + printf '\e[1;35m%-6s\e[m\n' "Loop script − ${script} doesn't seems to exist. Abort." + exit 1 + fi + + ## Run the script + sh "${script_wd}/${script}" + +done + +exit 0