mora-scripts
Version:
Some collection scripts by myself
41 lines (35 loc) • 885 B
JavaScript
/**
* Generated by mora-scripts. Do not edit this file.
*/
var dirname = require('path').dirname
var root = dirname(dirname(__dirname))
var cmd = __filename.replace(__dirname, '').substr(1)
var pkg
try {
pkg = require('../../package.json')
if (!internalRequire()) {
require('mora-scripts/hooks/scripts/runner')(root, cmd)
}
} catch (e) {
if (pkg && pkg.config && pkg.config.hooks && Object.keys(pkg.config.hooks).length) {
warnAboutGHooks()
}
}
// for internal use
function internalRequire() {
try {
if (pkg.name === 'mora-scripts') {
require('../../hooks/scripts/runner')(root, cmd)
return true
}
} catch (e) {}
}
function warnAboutGHooks() {
console.warn(
'\x1b[33m'
+ 'mora-scripts not found!\n'
+ 'Make sure you have it installed on your "node_modules".\n'
+ 'Skipping git hooks.\x1b[0m'
)
}