diff --git a/scripts/templates/behat-plugin/classes/output/mobile.php b/local-moodleappbehat/classes/output/mobile.php similarity index 100% rename from scripts/templates/behat-plugin/classes/output/mobile.php rename to local-moodleappbehat/classes/output/mobile.php diff --git a/scripts/templates/behat-plugin/classes/privacy/provider.php b/local-moodleappbehat/classes/privacy/provider.php similarity index 100% rename from scripts/templates/behat-plugin/classes/privacy/provider.php rename to local-moodleappbehat/classes/privacy/provider.php diff --git a/scripts/templates/behat-plugin/db/mobile.php b/local-moodleappbehat/db/mobile.php similarity index 100% rename from scripts/templates/behat-plugin/db/mobile.php rename to local-moodleappbehat/db/mobile.php diff --git a/scripts/templates/behat-plugin/js/mobile/index.js b/local-moodleappbehat/js/mobile/index.js similarity index 100% rename from scripts/templates/behat-plugin/js/mobile/index.js rename to local-moodleappbehat/js/mobile/index.js diff --git a/scripts/templates/behat-plugin/lang/en/local_moodleappbehat.php b/local-moodleappbehat/lang/en/local_moodleappbehat.php similarity index 100% rename from scripts/templates/behat-plugin/lang/en/local_moodleappbehat.php rename to local-moodleappbehat/lang/en/local_moodleappbehat.php diff --git a/tests/behat/app_behat_runtime.js b/local-moodleappbehat/tests/behat/app_behat_runtime.js similarity index 100% rename from tests/behat/app_behat_runtime.js rename to local-moodleappbehat/tests/behat/app_behat_runtime.js diff --git a/tests/behat/behat_app.php b/local-moodleappbehat/tests/behat/behat_app.php similarity index 100% rename from tests/behat/behat_app.php rename to local-moodleappbehat/tests/behat/behat_app.php diff --git a/tests/behat/behat_performance.php b/local-moodleappbehat/tests/behat/behat_performance.php similarity index 100% rename from tests/behat/behat_performance.php rename to local-moodleappbehat/tests/behat/behat_performance.php diff --git a/tests/behat/classes/performance_measure.php b/local-moodleappbehat/tests/behat/classes/performance_measure.php similarity index 100% rename from tests/behat/classes/performance_measure.php rename to local-moodleappbehat/tests/behat/classes/performance_measure.php diff --git a/scripts/templates/behat-plugin/version.php b/local-moodleappbehat/version.php similarity index 100% rename from scripts/templates/behat-plugin/version.php rename to local-moodleappbehat/version.php diff --git a/scripts/build-behat-plugin.js b/scripts/build-behat-plugin.js index 810243ac6..1d0570d7b 100755 --- a/scripts/build-behat-plugin.js +++ b/scripts/build-behat-plugin.js @@ -46,23 +46,20 @@ async function main() { // Copy plugin template. const { version: appVersion } = require(projectPath('package.json')); - const templatePath = projectPath('scripts/templates/behat-plugin'); + const templatePath = projectPath('local-moodleappbehat'); + + + copySync(templatePath, pluginPath); + + // Update version.php + const pluginFilePath = pluginPath + '/version.php'; + const fileContents = readFileSync(pluginFilePath).toString(); + const replacements = { appVersion, pluginVersion: getMoodlePluginVersion(), }; - - copySync(templatePath, pluginPath); - - for await (const templateFilePath of getDirectoryFiles(templatePath)) { - const pluginFilePath = pluginPath + templateFilePath.substr(templatePath.length); - const fileContents = readFileSync(pluginFilePath).toString(); - - writeFileSync(pluginFilePath, replaceArguments(fileContents, replacements)); - } - - // Copy plugin files. - copySync(projectPath('tests/behat'), `${pluginPath}/tests/behat`); + writeFileSync(pluginFilePath, replaceArguments(fileContents, replacements)); // Copy feature files. const behatTempFeaturesPath = `${pluginPath}/behat-tmp`;