/
getScript.ts.snap
109 lines (90 loc) 路 2.87 KB
/
getScript.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`hookScript should match snapshot (OS X/Linux) 1`] = `
"#!/bin/sh
# husky
# Hook created by Husky
# Version: 3.0.5
# At: <locale date string>
# See: https://github.com/typicode/husky#readme
# From
# Directory: /home/typicode/projects/foo-package
# Homepage: https://github.com/foo/foo-package
scriptPath=\\"node_modules/husky/run.js\\"
hookName=\`basename \\"$0\\"\`
gitParams=\\"$*\\"
debug() {
if [ \\"\${HUSKY_DEBUG}\\" = \\"true\\" ] || [ \\"\${HUSKY_DEBUG}\\" = \\"1\\" ]; then
echo \\"husky:debug $1\\"
fi
}
debug \\"$hookName hook started\\"
if [ \\"\${HUSKY_SKIP_HOOKS}\\" = \\"true\\" ] || [ \\"\${HUSKY_SKIP_HOOKS}\\" = \\"1\\" ]; then
debug \\"HUSKY_SKIP_HOOKS is set to \${HUSKY_SKIP_HOOKS}, skipping hook\\"
exit 0
fi
if [ \\"\${HUSKY_USE_YARN}\\" = \\"true\\" ] || [ \\"\${HUSKY_USE_YARN}\\" = \\"1\\" ]; then
debug \\"calling husky through Yarn\\"
yarn husky-run $hookName \\"$gitParams\\"
else
if ! command -v node >/dev/null 2>&1; then
echo \\"Info: can't find node in PATH, trying to find a node binary on your system\\"
fi
if [ -f \\"$scriptPath\\" ]; then
# if [ -t 1 ]; then
# exec < /dev/tty
# fi
if [ -f ~/.huskyrc ]; then
debug \\"source ~/.huskyrc\\"
. ~/.huskyrc
fi
node_modules/run-node/run-node \\"$scriptPath\\" $hookName \\"$gitParams\\"
else
echo \\"Can't find Husky, skipping $hookName hook\\"
echo \\"You can reinstall it using 'npm install husky --save-dev' or delete this hook\\"
fi
fi
"
`;
exports[`hookScript should match snapshot (Windows) 1`] = `
"#!/bin/sh
# husky
# Hook created by Husky
# Version: 3.0.5
# At: <locale date string>
# See: https://github.com/typicode/husky#readme
# From
# Directory: /home/typicode/projects/foo-package
# Homepage: https://github.com/foo/foo-package
scriptPath=\\"node_modules/husky/run.js\\"
hookName=\`basename \\"$0\\"\`
gitParams=\\"$*\\"
debug() {
if [ \\"\${HUSKY_DEBUG}\\" = \\"true\\" ] || [ \\"\${HUSKY_DEBUG}\\" = \\"1\\" ]; then
echo \\"husky:debug $1\\"
fi
}
debug \\"$hookName hook started\\"
if [ \\"\${HUSKY_SKIP_HOOKS}\\" = \\"true\\" ] || [ \\"\${HUSKY_SKIP_HOOKS}\\" = \\"1\\" ]; then
debug \\"HUSKY_SKIP_HOOKS is set to \${HUSKY_SKIP_HOOKS}, skipping hook\\"
exit 0
fi
if [ \\"\${HUSKY_USE_YARN}\\" = \\"true\\" ] || [ \\"\${HUSKY_USE_YARN}\\" = \\"1\\" ]; then
debug \\"calling husky through Yarn\\"
yarn husky-run $hookName \\"$gitParams\\"
else
if [ -f \\"$scriptPath\\" ]; then
# if [ -t 1 ]; then
# exec < /dev/tty
# fi
if [ -f ~/.huskyrc ]; then
debug \\"source ~/.huskyrc\\"
. ~/.huskyrc
fi
node \\"$scriptPath\\" $hookName \\"$gitParams\\"
else
echo \\"Can't find Husky, skipping $hookName hook\\"
echo \\"You can reinstall it using 'npm install husky --save-dev' or delete this hook\\"
fi
fi
"
`;