Skip to content

Commit

Permalink
fix: init error
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 25, 2024
1 parent e9526fd commit 020bbd6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin.js
Expand Up @@ -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 {}
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/config.mts
Expand Up @@ -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,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="85">🐶</text></svg>' }],
],
base: '/husky/',
themeConfig: {
// outline: [2, 3],
Expand Down
3 changes: 2 additions & 1 deletion test.sh
Expand Up @@ -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
6 changes: 6 additions & 0 deletions test/7_init.sh
@@ -0,0 +1,6 @@
#!/bin/sh
. test/functions.sh
setup
install

npx --no-install husky init
File renamed without changes.

0 comments on commit 020bbd6

Please sign in to comment.