@penskemediacorp/larva 1.78.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.
- package/bin/install-hooks.js +12 -4
- package/build/css/larva-important.css +1 -1
- package/build/css/larva.css +1 -1
- package/build/css/larva.inline-important.css +1 -1
- package/build/css/larva.inline.css +1 -1
- package/build/js/standalone/video-showcase.js +1 -1
- package/build/svg/defs/sprite.defs.html +1 -1
- package/lib/utils/renderSass.js +1 -1
- package/package.json +12 -12
- package/scripts/config/gulpfile.js +1 -1
package/bin/install-hooks.js
CHANGED
|
@@ -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
|
|
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(
|
|
83
|
-
|
|
84
|
-
|
|
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;
|