@penskemediacorp/larva 1.79.0 → 1.80.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ const colors = {
22
22
  };
23
23
 
24
24
  function log( message, color = 'reset' ) {
25
+ // eslint-disable-next-line no-console
25
26
  console.log( `${ colors[ color ] }${ message }${ colors.reset }` );
26
27
  }
27
28
 
@@ -50,7 +51,9 @@ function findGitRoot() {
50
51
  const parts = currentDir.split( path.sep );
51
52
  const nodeModulesIndex = parts.lastIndexOf( 'node_modules' );
52
53
  if ( nodeModulesIndex > 0 ) {
53
- const projectRoot = parts.slice( 0, nodeModulesIndex ).join( path.sep );
54
+ const projectRoot = parts
55
+ .slice( 0, nodeModulesIndex )
56
+ .join( path.sep );
54
57
  const gitDir = path.join( projectRoot, '.git' );
55
58
  if ( fs.existsSync( gitDir ) ) {
56
59
  return projectRoot;
@@ -79,9 +82,14 @@ function installHooks() {
79
82
 
80
83
  // Source hook is in bin folder (same directory as this script)
81
84
  const sourceHookPath = path.join( __dirname, 'pre-push' );
82
- const targetHookPath = path.join( gitRoot, '.git', 'hooks', 'pre-push' );
83
-
84
- if (!fs.existsSync(sourceHookPath)) {
85
+ const targetHookPath = path.join(
86
+ gitRoot,
87
+ '.git',
88
+ 'hooks',
89
+ 'pre-push'
90
+ );
91
+
92
+ if ( ! fs.existsSync( sourceHookPath ) ) {
85
93
  log( '⚠️ Larva pre-push hook not found', 'yellow' );
86
94
  log( `Looking in: ${ sourceHookPath }`, 'yellow' );
87
95
  return false;