Commit a061f676 authored by mathieso's avatar mathieso

Better error reporting.

parent 77f194b5
...@@ -74,7 +74,9 @@ if (!$fileNameListFile) { ...@@ -74,7 +74,9 @@ if (!$fileNameListFile) {
} }
echo "Copying files...\n"; echo "Copying files...\n";
$fileNamesToCopy = []; $fileNamesToCopy = [];
$allFileDataOk = TRUE;
while (!feof($fileNameListFile)) { while (!feof($fileNameListFile)) {
$isThisFileOk = TRUE;
$line = strtolower(trim(fgets($fileNameListFile))); $line = strtolower(trim(fgets($fileNameListFile)));
// Skip blank lines. // Skip blank lines.
if (!$line || strlen($line) == 0) { if (!$line || strlen($line) == 0) {
...@@ -88,7 +90,8 @@ while (!feof($fileNameListFile)) { ...@@ -88,7 +90,8 @@ while (!feof($fileNameListFile)) {
// Should be a space. // Should be a space.
if ($line[-3] !== ' ') { if ($line[-3] !== ' ') {
echo "Expected space in $line\n"; echo "Expected space in $line\n";
exit(1); $isThisFileOk = FALSE;
continue;
} }
// Which module/destination? // Which module/destination?
$lastTwoChars = substr($line, -2, 2); $lastTwoChars = substr($line, -2, 2);
...@@ -131,22 +134,33 @@ while (!feof($fileNameListFile)) { ...@@ -131,22 +134,33 @@ while (!feof($fileNameListFile)) {
default: default:
echo "Bad destination in $line\n"; echo "Bad destination in $line\n";
exit(1); $isThisFileOk = FALSE;
}; };
// Strip last three characters. if ($isThisFileOk) {
$line = substr($line, 0, -3); // Strip last three characters.
// Check that the named file exists. $line = substr($line, 0, -3);
if (!file_exists($pathToAllConfigFilesDir . '/' . $line)) { // Check that the named file exists.
echo "Could not find file: $line\n"; if (!file_exists($pathToAllConfigFilesDir . '/' . $line)) {
continue; echo "Could not find file: $line\n";
$isThisFileOk = FALSE;
continue;
}
$fileNamesToCopy[] = [
'filename' => $line,
'destination' => $destination,
];
}
if (!$isThisFileOk) {
$allFileDataOk = FALSE;
} }
$fileNamesToCopy[] = [
'filename' => $line,
'destination' => $destination,
];
} }
fclose($fileNameListFile); fclose($fileNameListFile);
if (!$allFileDataOk) {
echo "Stopped, not complete.\n";
exit(1);
}
// Copy the files. // Copy the files.
$fileCount = 0; $fileCount = 0;
foreach ($fileNamesToCopy as $fileInfo) { foreach ($fileNamesToCopy as $fileInfo) {
......
...@@ -51,26 +51,26 @@ user.role.student.yml uo ...@@ -51,26 +51,26 @@ user.role.student.yml uo
# HISTORY MODULE # HISTORY MODULE
# Field storage # Field storage
field.storage.skilling_history.field_badge.yml field.storage.skilling_history.field_badge.yml ho
field.storage.skilling_history.field_fib_item.yml ho field.storage.skilling_history.field_fib_item.yml ho
field.storage.skilling_history.field_internal_name.yml field.storage.skilling_history.field_internal_name.yml ho
field.storage.skilling_history.field_is_correct.yml ho field.storage.skilling_history.field_is_correct.yml ho
field.storage.skilling_history.field_mcq_item.yml ho field.storage.skilling_history.field_mcq_item.yml ho
field.storage.skilling_history.field_message.yml field.storage.skilling_history.field_message.yml ho
field.storage.skilling_history.field_node.yml field.storage.skilling_history.field_node.yml ho
field.storage.skilling_history.field_note.yml field.storage.skilling_history.field_note.yml ho
field.storage.skilling_history.field_operation.yml ho field.storage.skilling_history.field_operation.yml ho
field.storage.skilling_history.field_page_type.yml ho field.storage.skilling_history.field_page_type.yml ho
field.storage.skilling_history.field_page.yml ho field.storage.skilling_history.field_page.yml ho
field.storage.skilling_history.field_recipient.yml field.storage.skilling_history.field_recipient.yml ho
field.storage.skilling_history.field_response_text.yml ho field.storage.skilling_history.field_response_text.yml ho
field.storage.skilling_history.field_response.yml ho field.storage.skilling_history.field_response.yml ho
field.storage.skilling_history.field_search_text.yml field.storage.skilling_history.field_search_text.yml ho
field.storage.skilling_history.field_subject.yml field.storage.skilling_history.field_subject.yml ho
field.storage.skilling_history.field_submission.yml ho field.storage.skilling_history.field_submission.yml ho
field.storage.skilling_history.field_suggestion.yml field.storage.skilling_history.field_suggestion.yml ho
field.storage.skilling_history.field_user.yml field.storage.skilling_history.field_user.yml ho
field.storage.skilling_history.field_view_id.yml field.storage.skilling_history.field_view_id.yml ho
# Bundles # Bundles
...@@ -189,7 +189,6 @@ field.storage.node.field_class.yml co ...@@ -189,7 +189,6 @@ field.storage.node.field_class.yml co
field.storage.node.field_class_roles.yml co field.storage.node.field_class_roles.yml co
field.storage.node.field_complete.yml co field.storage.node.field_complete.yml co
field.storage.node.field_completion_score.yml co field.storage.node.field_completion_score.yml co
field.storage.node.field_days.yml co
field.storage.node.field_difficulty.yml co field.storage.node.field_difficulty.yml co
field.storage.node.field_difficulty_reasons.yml co field.storage.node.field_difficulty_reasons.yml co
field.storage.node.field_exercise.yml co field.storage.node.field_exercise.yml co
...@@ -508,10 +507,10 @@ paragraphs.settings.yml co ...@@ -508,10 +507,10 @@ paragraphs.settings.yml co
paragraphs.paragraphs_type.exercise_due.yml co paragraphs.paragraphs_type.exercise_due.yml co
core.entity_form_display.paragraph.exercise_due.default.yml co core.entity_form_display.paragraph.exercise_due.default.yml co
core.entity_view_display.paragraph.exercise_due.default.yml co core.entity_view_display.paragraph.exercise_due.default.yml co
field.field.paragraph.exercise_due.field_day.yml field.field.paragraph.exercise_due.field_day.yml co
field.field.paragraph.exercise_due.field_exercise.yml field.field.paragraph.exercise_due.field_exercise.yml co
field.field.paragraph.exercise_due.field_maximum_submissions.yml field.field.paragraph.exercise_due.field_maximum_submissions.yml co
field.field.paragraph.exercise_due.field_required.yml field.field.paragraph.exercise_due.field_required.yml co
# FiB question response # FiB question response
paragraphs.paragraphs_type.fill_in_the_blank_question_respo.yml co paragraphs.paragraphs_type.fill_in_the_blank_question_respo.yml co
...@@ -633,7 +632,6 @@ pathauto.pattern.badge.yml co ...@@ -633,7 +632,6 @@ pathauto.pattern.badge.yml co
pathauto.pattern.character.yml co pathauto.pattern.character.yml co
pathauto.pattern.classes.yml co pathauto.pattern.classes.yml co
pathauto.pattern.design_pages.yml co pathauto.pattern.design_pages.yml co
pathauto.pattern.enrollment.yml co
pathauto.pattern.exercises.yml co pathauto.pattern.exercises.yml co
pathauto.pattern.fill_in_the_blank.yml co pathauto.pattern.fill_in_the_blank.yml co
pathauto.pattern.lessons.yml co pathauto.pattern.lessons.yml co
...@@ -641,10 +639,7 @@ pathauto.pattern.models.yml co ...@@ -641,10 +639,7 @@ pathauto.pattern.models.yml co
pathauto.pattern.multiple_choice_question.yml co pathauto.pattern.multiple_choice_question.yml co
pathauto.pattern.pattern.yml co pathauto.pattern.pattern.yml co
pathauto.pattern.principle.yml co pathauto.pattern.principle.yml co
pathauto.pattern.reflect_note.yml co
pathauto.pattern.rubric_item.yml co pathauto.pattern.rubric_item.yml co
pathauto.pattern.submission.yml co
pathauto.pattern.suggestion.yml co
system.action.pathauto_update_alias_node.yml co system.action.pathauto_update_alias_node.yml co
system.action.pathauto_update_alias_user.yml co system.action.pathauto_update_alias_user.yml co
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment