Skip to content

Instantly share code, notes, and snippets.

View heyman333's full-sized avatar
☀️
SUPER BUSY

lake.zero(레이크/한영수) heyman333

☀️
SUPER BUSY
View GitHub Profile
@heyman333
heyman333 / ts-precommit.bash
Created March 19, 2020 04:45 — forked from dcurletti/ts-precommit.bash
Bash script to typecheck project on TypeScript file changes
#!/bin/bash
# You can make the script more generic by changing the matching pattern
SRC_PATTERN=".*\.(ts|tsx)$"
# needed bc env vars change when run inside a git hook
# https://stackoverflow.com/questions/3542854/calling-git-pull-from-a-git-post-update-hook
# https://serverfault.com/questions/107608/git-post-receive-hook-with-git-pull-failed-to-find-a-valid-git-directory
unset $(git rev-parse --local-env-vars)