From ae66c2f20d60c9b60f9f19135cb94655d495e059 Mon Sep 17 00:00:00 2001 From: Halvor Haugan Date: Wed, 13 Nov 2024 13:03:27 +0100 Subject: [PATCH 1/4] Git hooks that notify when yarn.lock have changed --- .husky/post-checkout | 8 ++++++++ .husky/post-merge | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 .husky/post-checkout create mode 100644 .husky/post-merge diff --git a/.husky/post-checkout b/.husky/post-checkout new file mode 100644 index 0000000000..3282069d5e --- /dev/null +++ b/.husky/post-checkout @@ -0,0 +1,8 @@ +#!/bin/sh + +CHANGED=`git diff $1 $2 --stat -- yarn.lock | wc -l` +if [ $CHANGED -gt 0 ]; +then + echo + echo "*** yarn.lock has changed ***" +fi \ No newline at end of file diff --git a/.husky/post-merge b/.husky/post-merge new file mode 100644 index 0000000000..ea417eda46 --- /dev/null +++ b/.husky/post-merge @@ -0,0 +1,8 @@ +#!/bin/sh + +CHANGED=`git diff HEAD@{1} --stat -- yarn.lock | wc -l` +if [ $CHANGED -gt 0 ]; +then + echo + echo "*** yarn.lock has changed ***" +fi \ No newline at end of file From c1e5025434ebf68d73bf02a68c8cd91d926bf35d Mon Sep 17 00:00:00 2001 From: Halvor Haugan Date: Wed, 13 Nov 2024 13:30:21 +0100 Subject: [PATCH 2/4] permissions --- .husky/post-checkout | 0 .husky/post-merge | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .husky/post-checkout mode change 100644 => 100755 .husky/post-merge diff --git a/.husky/post-checkout b/.husky/post-checkout old mode 100644 new mode 100755 diff --git a/.husky/post-merge b/.husky/post-merge old mode 100644 new mode 100755 From f02ec864d6792914bf063da840a2bebe661d6e45 Mon Sep 17 00:00:00 2001 From: Halvor Haugan Date: Wed, 13 Nov 2024 13:36:49 +0100 Subject: [PATCH 3/4] tried husky add --- .husky/post-checkout | 15 ++++++++------- .husky/post-merge | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.husky/post-checkout b/.husky/post-checkout index 3282069d5e..8519fb449a 100755 --- a/.husky/post-checkout +++ b/.husky/post-checkout @@ -1,8 +1,9 @@ -#!/bin/sh - -CHANGED=`git diff $1 $2 --stat -- yarn.lock | wc -l` -if [ $CHANGED -gt 0 ]; -then - echo - echo "*** yarn.lock has changed ***" +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +CHANGED=`git diff $1 $2 --stat -- yarn.lock | wc -l` +if [ $CHANGED -gt 0 ]; +then + echo + echo "*** yarn.lock has changed ***" fi \ No newline at end of file diff --git a/.husky/post-merge b/.husky/post-merge index ea417eda46..4cc3e039ff 100755 --- a/.husky/post-merge +++ b/.husky/post-merge @@ -1,8 +1,9 @@ -#!/bin/sh - -CHANGED=`git diff HEAD@{1} --stat -- yarn.lock | wc -l` -if [ $CHANGED -gt 0 ]; -then - echo - echo "*** yarn.lock has changed ***" +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +CHANGED=`git diff HEAD@{1} --stat -- yarn.lock | wc -l` +if [ $CHANGED -gt 0 ]; +then + echo + echo "*** yarn.lock has changed ***" fi \ No newline at end of file From 8a18b1a6bb0405359e0404f3130de20a7d9169e4 Mon Sep 17 00:00:00 2001 From: Halvor Haugan Date: Wed, 13 Nov 2024 13:53:31 +0100 Subject: [PATCH 4/4] icon --- .husky/post-checkout | 2 +- .husky/post-merge | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/post-checkout b/.husky/post-checkout index 8519fb449a..220b1d6c7f 100755 --- a/.husky/post-checkout +++ b/.husky/post-checkout @@ -5,5 +5,5 @@ CHANGED=`git diff $1 $2 --stat -- yarn.lock | wc -l` if [ $CHANGED -gt 0 ]; then echo - echo "*** yarn.lock has changed ***" + echo "*** 🟡 yarn.lock has changed 🟡 ***" fi \ No newline at end of file diff --git a/.husky/post-merge b/.husky/post-merge index 4cc3e039ff..6999a8154d 100755 --- a/.husky/post-merge +++ b/.husky/post-merge @@ -5,5 +5,5 @@ CHANGED=`git diff HEAD@{1} --stat -- yarn.lock | wc -l` if [ $CHANGED -gt 0 ]; then echo - echo "*** yarn.lock has changed ***" + echo "*** 🟡 yarn.lock has changed 🟡 ***" fi \ No newline at end of file