From 5da193d711f464ab23dae8988ed7f5dbbe6212df Mon Sep 17 00:00:00 2001 From: Moinul Moin Date: Sat, 29 Jul 2023 16:43:53 +0600 Subject: [PATCH] test lefthook --- .husky/pre-commit | 42 ++++++++++++++++++++++++++++++++++++++ src/app/dashboard/page.tsx | 4 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..39eb667 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,42 @@ +#!/bin/sh + +if [ "$LEFTHOOK" = "0" ]; then + exit 0 +fi + +call_lefthook() +{ + dir="$(git rev-parse --show-toplevel)" + osArch=$(uname | tr '[:upper:]' '[:lower:]') + cpuArch=$(uname -m | sed 's/aarch64/arm64/') + + if lefthook -h >/dev/null 2>&1 + then + lefthook "$@" + elif test -f "$dir/node_modules/lefthook/bin/index.js" + then + "$dir/node_modules/lefthook/bin/index.js" "$@" + elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" + then + "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@" + elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" + then + "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@" + elif bundle exec lefthook -h >/dev/null 2>&1 + then + bundle exec lefthook "$@" + elif yarn lefthook -h >/dev/null 2>&1 + then + yarn lefthook "$@" + elif pnpm lefthook -h >/dev/null 2>&1 + then + pnpm lefthook "$@" + elif command -v npx >/dev/null 2>&1 + then + npx @evilmartians/lefthook "$@" + else + echo "Can't find lefthook in PATH" + fi +} + +call_lefthook run "pre-commit" "$@" diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index aa5d84a..32abd56 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,7 +1,7 @@ -import { Metadata } from "next"; +import { type Metadata } from "next"; export const metadata: Metadata = { - title: "Overview", + title: "Overview0", }; export default function Dashboard() {