UNPKG

git-pre-commit

Version:

You can run the pre-commit with any build tool (Gulp, Grunt etc..) and it will ignore all the **unstaged changes** that wasn't added to the git index (using the command ```git add```).

31 lines (26 loc) 454 B
/** * @fileoverview Path extra functions */ /** * Extra utils around the use of the path module * @class */ class PathUtils { /** * Checks if a given path exists or not * @param path * @returns {boolean} */ static doesPathExists(path) { const fs = require('fs'); try { // Query the entry fs.lstatSync(path); return true; } catch (e) { return false; } } } module.exports = PathUtils;