This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree 7 files changed +18
-8
lines changed
cna-template/template/nuxt/.husky
7 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
. " $( dirname " $0 " ) /_/husky.sh"
3
+ . " $( dirname " $0 " ) /common.sh"
3
4
4
5
yarn commitlint --edit $1
Original file line number Diff line number Diff line change
1
+ command_exists () {
2
+ command -v " $1 " > /dev/null 2>&1
3
+ }
4
+
5
+ # Workaround for Windows 10, Git Bash and Yarn
6
+ if command_exists winpty && test -t 1; then
7
+ exec < /dev/tty
8
+ fi
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
. " $( dirname " $0 " ) /_/husky.sh"
3
+ . " $( dirname " $0 " ) /common.sh"
3
4
4
5
yarn lint && yarn test -u && git add ./packages/* /test/snapshots/*
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
. " $( dirname " $0 " ) /_/husky.sh"
3
+ < %_ if (pm === ' yarn' ) { _%>
3
4
. " $( dirname " $0 " ) /common.sh"
5
+ < %_ } _%>
4
6
5
- < %= pmRun === ' yarn' ? ' yarn' : ' npx' %> commitlint --edit $1
7
+ < %= pm === ' yarn' ? ' yarn' : ' npx --no-install ' %> commitlint --edit $1
Original file line number Diff line number Diff line change 1
- < %_ if (isWindows === true) { _%>
2
1
command_exists () {
3
2
command -v " $1 " > /dev/null 2>&1
4
3
}
@@ -7,4 +6,3 @@ command_exists () {
7
6
if command_exists winpty && test -t 1; then
8
7
exec < /dev/tty
9
8
fi
10
- < %_ } _%>
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
. " $( dirname " $0 " ) /_/husky.sh"
3
+ < %_ if (pm === ' yarn' ) { _%>
3
4
. " $( dirname " $0 " ) /common.sh"
5
+ < %_ } _%>
4
6
5
- < %= pmRun === ' yarn' ? ' yarn' : ' npx' %> lint-staged
7
+ < %= pm === ' yarn' ? ' yarn' : ' npx --no-install ' %> lint-staged
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ const validate = require('validate-npm-package-name')
5
5
const pkg = require ( './package' )
6
6
7
7
const cnaTemplateDir = join ( dirname ( require . resolve ( 'cna-template/package.json' ) ) )
8
- const isWindows = process . platform === 'win32'
9
8
const templateDir = join ( cnaTemplateDir , 'template' )
10
9
const frameworksDir = join ( templateDir , 'frameworks' )
11
10
const addExecutable = filename => new Promise (
@@ -41,8 +40,7 @@ module.exports = {
41
40
edge,
42
41
pm,
43
42
pmRun,
44
- content,
45
- isWindows
43
+ content
46
44
}
47
45
} ,
48
46
actions ( ) {
@@ -72,7 +70,7 @@ module.exports = {
72
70
'.husky/.gitignore' : husky ,
73
71
'.husky/commit-msg' : commitlint ,
74
72
'.husky/pre-commit' : lintStaged ,
75
- '.husky/common.sh' : husky
73
+ '.husky/common.sh' : husky && this . answers . pm === 'yarn'
76
74
}
77
75
} ]
78
76
You can’t perform that action at this time.
0 commit comments