Skip to content

Commit 974a6df

Browse files
author
Vladimir Enchev
committed
XML validation fixed
1 parent b956140 commit 974a6df

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/services/platform-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ export class PlatformService implements IPlatformService {
268268
sourceFiles = sourceFiles.filter(source => !minimatch(source, `**/${constants.TNS_MODULES_FOLDER_NAME}/**`, { nocase: true }));
269269
}
270270

271-
// verify .xml files are well-formed
272-
this.$xmlValidator.validateXmlFiles(sourceFiles).wait();
271+
// Verify .xml files are well-formed. If not valid stop the transfer.
272+
if(!this.$xmlValidator.validateXmlFiles(sourceFiles).wait()){
273+
this.$errors.failWithoutHelp("Invalid or not well-formed XML files detected!");
274+
return false;
275+
}
273276

274277
// Remove .ts and .js.map files
275278
constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, { nocase: true })));

lib/xml-validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export class XmlValidator implements IXmlValidator {
1818
let hasErrors = !!errorOutput;
1919
xmlHasErrors = xmlHasErrors || hasErrors;
2020
if (hasErrors) {
21-
this.$logger.warn(`${file} has syntax errors.`);
22-
this.$logger.out(errorOutput);
21+
this.$logger.info(`${file} has syntax errors.`.red.bold);
22+
this.$logger.out(errorOutput.yellow);
2323
}
2424
});
2525
return !xmlHasErrors;

0 commit comments

Comments
 (0)