From 36ba842fec4d0838c2c3d95c68921af9a1484210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 2 Jul 2021 15:17:43 +0200 Subject: [PATCH] MOBILE-3320 scripts: Fix not existing folder problem --- scripts/lang_functions.sh | 2 +- scripts/moodle_to_json.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/lang_functions.sh b/scripts/lang_functions.sh index cf6e2368a..ef7de3a0f 100755 --- a/scripts/lang_functions.sh +++ b/scripts/lang_functions.sh @@ -102,7 +102,7 @@ function get_language { pushd $LANGPACKSFOLDER > /dev/null curl -s $MOODLEORG_URL/$lastversion/$lang.zip --output $lang.zip > /dev/null - rm -R $lang + rm -R $lang > /dev/null 2>&1> /dev/null unzip -o -u $lang.zip > /dev/null # This is the AWS version to get the language but right now it's slower. diff --git a/scripts/moodle_to_json.php b/scripts/moodle_to_json.php index 610630f27..4a9831796 100644 --- a/scripts/moodle_to_json.php +++ b/scripts/moodle_to_json.php @@ -46,6 +46,11 @@ if (isset($argv[1]) && !empty($argv[1])) { $languages = $config_langs; } +if (!file_exists(ASSETSPATH)) { + mkdir(ASSETSPATH); +} + + $keys = get_langindex_keys(); $added_langs = build_languages($languages, $keys);