MOBILE-4061 behat: Group all moodleappbehat plugin files
parent
f48885b822
commit
0fd5078cf9
|
@ -46,23 +46,20 @@ async function main() {
|
||||||
|
|
||||||
// Copy plugin template.
|
// Copy plugin template.
|
||||||
const { version: appVersion } = require(projectPath('package.json'));
|
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 = {
|
const replacements = {
|
||||||
appVersion,
|
appVersion,
|
||||||
pluginVersion: getMoodlePluginVersion(),
|
pluginVersion: getMoodlePluginVersion(),
|
||||||
};
|
};
|
||||||
|
writeFileSync(pluginFilePath, replaceArguments(fileContents, replacements));
|
||||||
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`);
|
|
||||||
|
|
||||||
// Copy feature files.
|
// Copy feature files.
|
||||||
const behatTempFeaturesPath = `${pluginPath}/behat-tmp`;
|
const behatTempFeaturesPath = `${pluginPath}/behat-tmp`;
|
||||||
|
|
Loading…
Reference in New Issue