diff --git a/missions/basic/04_mkdir_chest/clean.sh b/missions/basic/04_mkdir_chest/clean.sh index 25c3bece..dc371525 100644 --- a/missions/basic/04_mkdir_chest/clean.sh +++ b/missions/basic/04_mkdir_chest/clean.sh @@ -5,6 +5,15 @@ case $GSH_LAST_ACTION in : ;; *) + case "$(pwd)" in + "$GSH_HOME"/*) + if echo "${PWD#$GSH_HOME/}" | grep -Eq "$(gettext "Hut")|$(gettext "Chest")" + then + cd "$GSH_HOME" + echo "$(gettext "You are back at the initial directory.")" + fi + ;; + esac find "$GSH_HOME" -iname "$(gettext "Hut")" -print0 | xargs -0 rm -rf find "$GSH_HOME" -iname "$(gettext "Chest")" -print0 | xargs -0 rm -rf ;; diff --git a/missions/basic/04_mkdir_chest/i18n/en.po b/missions/basic/04_mkdir_chest/i18n/en.po index 7d1115c0..fafdbce1 100644 --- a/missions/basic/04_mkdir_chest/i18n/en.po +++ b/missions/basic/04_mkdir_chest/i18n/en.po @@ -26,6 +26,9 @@ msgstr "Hut" msgid "The $dir_name directory does not exist!" msgstr "The $dir_name directory does not exist!" +msgid "You are back at the initial directory." +msgstr "You are back at the initial directory." + msgid "You built too many chests in your hut!" msgstr "You built too many chests in your hut!" diff --git a/missions/basic/04_mkdir_chest/i18n/fr.po b/missions/basic/04_mkdir_chest/i18n/fr.po index ca76c4a3..2804a443 100644 --- a/missions/basic/04_mkdir_chest/i18n/fr.po +++ b/missions/basic/04_mkdir_chest/i18n/fr.po @@ -25,6 +25,9 @@ msgstr "Hutte" msgid "The $dir_name directory does not exist!" msgstr "Le répertoire $dir_name n'existe pas !" +msgid "You are back at the initial directory." +msgstr "Vous êtes de retour au répertoire initial." + msgid "You built too many chests in your hut!" msgstr "Vous avez construit trop de coffres dans votre hutte !" diff --git a/missions/basic/04_mkdir_chest/i18n/template.pot b/missions/basic/04_mkdir_chest/i18n/template.pot index 2cd3c5e3..0ae8529c 100644 --- a/missions/basic/04_mkdir_chest/i18n/template.pot +++ b/missions/basic/04_mkdir_chest/i18n/template.pot @@ -25,6 +25,9 @@ msgstr "" msgid "The $dir_name directory does not exist!" msgstr "" +msgid "You are back at the initial directory." +msgstr "" + msgid "You built too many chests in your hut!" msgstr ""