affiance
Version:
A configurable and extendable Git hook manager for node projects
31 lines (26 loc) • 663 B
JavaScript
;
const HookBase = require('../Base');
/**
* @class PostCheckoutBase
* @extends HookBase
* @classdesc Base class for post-checkout hooks
*/
class PostCheckoutBase extends HookBase {
shouldSkipFileCheckout() {
return (this.config['skipFileCheckout'] !== false);
}
isEnabled() {
if(this.isFileCheckout() && this.shouldSkipFileCheckout()) {
return false;
}
return HookBase.prototype.isEnabled.call(this);
}
}
const CONTEXT_DELEGATIONS = [
'previousHead',
'newHead',
'isBranchCheckout',
'isFileCheckout'
];
HookBase.delegateToContext(PostCheckoutBase, CONTEXT_DELEGATIONS);
module.exports = PostCheckoutBase;