Skip to content

Commit 2596158

Browse files
committed
MDLSITE-8135 Export installer strings to the correct location
1 parent 4dfdb68 commit 2596158

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

cli/export-installer.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,16 @@
6161

6262
fputs(STDOUT, "PROCESSING VERSION {$version->code} ({$gitbranch})\n");
6363

64+
if ($version->code >= 501) {
65+
$installroot = 'public/install';
66+
} else {
67+
$installroot = 'install';
68+
}
69+
70+
$stringnamestxt = $installroot . '/stringnames.txt';
71+
6472
// Read the contents of stringnames.txt on the given branch.
65-
$gitout = $git->exec('show ' . escapeshellarg($gitbranch . ':install/stringnames.txt'));
73+
$gitout = $git->exec('show ' . escapeshellarg($gitbranch . ':' . $stringnamestxt));
6674

6775
$list = [];
6876

@@ -82,7 +90,7 @@
8290
* needed during the very first steps of installation. This file was
8391
* generated automatically by export-installer.php (which is part of AMOS
8492
* {@link https://moodledev.io/general/projects/api/amos}) using the
85-
* list of strings defined in /install/stringnames.txt.
93+
* list of strings defined in {$stringnamestxt} file.
8694
*
8795
* @package installer
8896
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -99,7 +107,7 @@
99107
$component = mlang_component::from_snapshot($componentname, $lang, $version, null, false, false,
100108
array_keys($stringids));
101109
if ($component->has_string()) {
102-
$file = AMOS_EXPORT_INSTALLER_DIR . '/' . $exportdir . '/install/lang/' . $lang . '/' . $component->name . '.php';
110+
$file = AMOS_EXPORT_INSTALLER_DIR . '/' . $exportdir . '/' . $installroot . '/lang/' . $lang . '/' . $component->name . '.php';
103111
if (!file_exists(dirname($file))) {
104112
mkdir(dirname($file), 0755, true);
105113
}

0 commit comments

Comments
 (0)