Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

fix: do not show warning for format differences in templates #947

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions projectFilesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { isTypeScript, isAngular, isVue } = require("./projectHelpers");

function addProjectFiles(projectDir) {
const projectTemplates = getProjectTemplates(projectDir);
Object.keys(projectTemplates).forEach(function(templateName) {
Object.keys(projectTemplates).forEach(function (templateName) {
const templateDestination = projectTemplates[templateName];
templateName = path.resolve(templateName);
copyTemplate(templateName, templateDestination);
Expand All @@ -14,7 +14,7 @@ function addProjectFiles(projectDir) {

function removeProjectFiles(projectDir) {
const projectTemplates = getProjectTemplates(projectDir);
Object.keys(projectTemplates).forEach(function(templateName) {
Object.keys(projectTemplates).forEach(function (templateName) {
const templateDestination = projectTemplates[templateName];
deleteFile(templateDestination);
});
Expand All @@ -32,7 +32,7 @@ function compareProjectFiles(projectDir) {
if (fs.existsSync(currentTemplatePath)) {
const currentTemplate = fs.readFileSync(currentTemplatePath).toString();
const newTemplate = fs.readFileSync(newTemplatePath).toString();
if (newTemplate !== currentTemplate) {
if (newTemplate.replace(/\s/g, '') !== currentTemplate.replace(/\s/g, '')) {
const message = `The current project contains a ${path.basename(currentTemplatePath)} file located at ${currentTemplatePath} that differs from the one in the new version of the nativescript-dev-webpack plugin located at ${newTemplatePath}. Some of the plugin features may not work as expected until you manually update the ${path.basename(currentTemplatePath)} file or automatically update it using "./node_modules/.bin/update-ns-webpack --configs" command.`;
console.info(`\x1B[33;1m${message}\x1B[0m`);
}
Expand Down