From 020bbd6c388e0f24a8b24251b172dc64f36f9910 Mon Sep 17 00:00:00 2001 From: typicode Date: Thu, 25 Jan 2024 16:05:11 +0100 Subject: [PATCH 1/2] fix: init error --- bin.js | 2 +- docs/.vitepress/config.mts | 3 +++ test.sh | 3 ++- test/7_init.sh | 6 ++++++ test/{7_time.sh => 8_time.sh} | 0 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 test/7_init.sh rename test/{7_time.sh => 8_time.sh} (100%) diff --git a/bin.js b/bin.js index 11164946d..13011eb92 100755 --- a/bin.js +++ b/bin.js @@ -7,7 +7,7 @@ let a = process.argv[2] if (a == 'init') { let p = 'package.json' let d = JSON.parse(f.readFileSync(p)) - (d.scripts ||= {}).prepare = 'husky' + ;(d.scripts ||= {}).prepare = 'husky' w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2) + '\n') process.stdout.write(i()) try { f.mkdirSync('.husky') } catch {} diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 56840856d..9e01fc888 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -4,6 +4,9 @@ import { defineConfig } from 'vitepress' export default defineConfig({ title: "Husky", description: "Git hooks made easy", + head: [ + ['link', { rel: 'icon', href: 'data:image/svg+xml,🐶' }], + ], base: '/husky/', themeConfig: { // outline: [2, 3], diff --git a/test.sh b/test.sh index 5333af740..6f6d9d406 100755 --- a/test.sh +++ b/test.sh @@ -8,4 +8,5 @@ sh test/3_from-sub-dir.sh sh test/4_not-git-dir.sh sh test/5_git_command_not_found.sh sh test/6_command_not_found.sh -# sh test/7_time.sh +sh test/7_init.sh +# sh test/8_time.sh diff --git a/test/7_init.sh b/test/7_init.sh new file mode 100644 index 000000000..7a498cc41 --- /dev/null +++ b/test/7_init.sh @@ -0,0 +1,6 @@ +#!/bin/sh +. test/functions.sh +setup +install + +npx --no-install husky init \ No newline at end of file diff --git a/test/7_time.sh b/test/8_time.sh similarity index 100% rename from test/7_time.sh rename to test/8_time.sh From f26f429f8bcfa4015ac41d75936de50464134a4e Mon Sep 17 00:00:00 2001 From: typicode Date: Thu, 25 Jan 2024 16:07:42 +0100 Subject: [PATCH 2/2] Update config.mts --- docs/.vitepress/config.mts | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 9e01fc888..56840856d 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -4,9 +4,6 @@ import { defineConfig } from 'vitepress' export default defineConfig({ title: "Husky", description: "Git hooks made easy", - head: [ - ['link', { rel: 'icon', href: 'data:image/svg+xml,🐶' }], - ], base: '/husky/', themeConfig: { // outline: [2, 3],