This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +18
-8
lines changed
cna-template/template/nuxt/.husky Expand file tree Collapse file tree 7 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22. " $( dirname " $0 " ) /_/husky.sh"
3+ . " $( dirname " $0 " ) /common.sh"
34
45yarn 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 11#! /bin/sh
22. " $( dirname " $0 " ) /_/husky.sh"
3+ . " $( dirname " $0 " ) /common.sh"
34
45yarn lint && yarn test -u && git add ./packages/* /test/snapshots/*
Original file line number Diff line number Diff line change 11#! /bin/sh
22. " $( dirname " $0 " ) /_/husky.sh"
3+ < %_ if (pm === ' yarn' ) { _%>
34. " $( dirname " $0 " ) /common.sh"
5+ < %_ } _%>
46
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) { _%>
21command_exists () {
32 command -v " $1 " > /dev/null 2>&1
43}
@@ -7,4 +6,3 @@ command_exists () {
76if command_exists winpty && test -t 1; then
87 exec < /dev/tty
98fi
10- < %_ } _%>
Original file line number Diff line number Diff line change 11#! /bin/sh
22. " $( dirname " $0 " ) /_/husky.sh"
3+ < %_ if (pm === ' yarn' ) { _%>
34. " $( dirname " $0 " ) /common.sh"
5+ < %_ } _%>
46
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')
55const pkg = require ( './package' )
66
77const cnaTemplateDir = join ( dirname ( require . resolve ( 'cna-template/package.json' ) ) )
8- const isWindows = process . platform === 'win32'
98const templateDir = join ( cnaTemplateDir , 'template' )
109const frameworksDir = join ( templateDir , 'frameworks' )
1110const addExecutable = filename => new Promise (
@@ -41,8 +40,7 @@ module.exports = {
4140 edge,
4241 pm,
4342 pmRun,
44- content,
45- isWindows
43+ content
4644 }
4745 } ,
4846 actions ( ) {
@@ -72,7 +70,7 @@ module.exports = {
7270 '.husky/.gitignore' : husky ,
7371 '.husky/commit-msg' : commitlint ,
7472 '.husky/pre-commit' : lintStaged ,
75- '.husky/common.sh' : husky
73+ '.husky/common.sh' : husky && this . answers . pm === 'yarn'
7674 }
7775 } ]
7876
You can’t perform that action at this time.
0 commit comments