File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ pre-commit:
243
243
run: npm run eslint {staged_files}
244
244
` ` `
245
245
246
- Provide a tweak to access `npm` executable the same way you do it in your ~/<shell>rc
246
+ Provide a tweak to access `npm` executable the same way you do it in your ~/<shell>rc.
247
247
248
248
` ` ` yml
249
249
# lefthook-local.yml
@@ -254,16 +254,25 @@ Provide a tweak to access `npm` executable the same way you do it in your ~/<she
254
254
rc: ~/.lefthookrc
255
255
` ` `
256
256
257
+ Or
258
+
259
+ ` ` ` yml
260
+ # lefthook-local.yml
261
+
262
+ # If the path contains spaces, you need to quote it.
263
+ rc: '"${XDG_CONFIG_HOME:-$HOME/.config}/lefthookrc"'
264
+ ` ` `
265
+
266
+ In the rc file, export any new environment variables or modify existing ones.
267
+
257
268
` ` ` bash
258
269
# ~/.lefthookrc
259
270
260
271
# An nvm way
261
-
262
272
export NVM_DIR="$HOME/.nvm"
263
273
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
264
274
265
275
# Or maybe just
266
-
267
276
PATH=$PATH:$HOME/.nvm/versions/node/v15.14.0/bin
268
277
` ` `
269
278
Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ if [ "$LEFTHOOK" = "0" ]; then
5
5
fi
6
6
7
7
{{- if .Rc}}
8
- {{/* Load rc file and export all ENV vars defined in it * /}}
9
- set -a
8
+ {{/* Load rc file, which may export ENV variables * /}}
10
9
[ -f {{.Rc}} ] && . {{.Rc}}
11
10
{{- end}}
12
11
You can’t perform that action at this time.
0 commit comments