flectra/addons/web/static/lib/pdfjs/external/crlfchecker/crlfchecker.js
flectra-admin 769eafb483 [INIT] Inception of Flectra from Odoo
Flectra is Forked from Odoo v11 commit : (6135e82d73)
2018-01-16 11:45:59 +05:30

30 lines
705 B
JavaScript

/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* jshint node:true */
/* globals cat, echo, exit, ls */
'use strict';
function checkIfCrlfIsPresent(files) {
var failed = [];
(ls(files)).forEach(function checkCrlf(file) {
if ((cat(file)).match(/.*\r.*/)) {
failed.push(file);
}
});
if (failed.length) {
var errorMessage =
'Please remove carriage return\'s from\n' + failed.join('\n') + '\n' +
'Also check your setting for: git config core.autocrlf.';
echo();
echo(errorMessage);
exit(1);
}
}
exports.checkIfCrlfIsPresent = checkIfCrlfIsPresent;