Skip to content

Commit d50e01a

Browse files
author
Hugo Rialan
committed
Add dataform_compile hook
1 parent 3925a74 commit d50e01a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@
44
language: script
55
files: (\.sqlx|\.js)$
66
pass_filenames: false
7+
8+
- id: dataform_compile
9+
name: Dataform compile
10+
entry: hooks/dataform_compile.sh
11+
language: script
12+
files: (\.sqlx|\.js)$
13+
pass_filenames: false

hooks/dataform_compile.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# Check if dataform command is available, if not install it
4+
if ! command -v dataform >/dev/null 2>&1; then
5+
echo "Dataform is not installed."
6+
echo "Trying to install Dataform..."
7+
npm i -g @dataform/cli@latest
8+
echo "Dataform installed successfully."
9+
fi
10+
11+
dataform compile
12+
13+
exit 0

0 commit comments

Comments
 (0)