We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73764e9 commit 4ca22aeCopy full SHA for 4ca22ae
2 files changed
.pre-commit-hooks.yaml
@@ -11,3 +11,10 @@
11
language: script
12
files: (\.sqlx|\.js)$
13
pass_filenames: false
14
+
15
+- id: dataform_dry_run
16
+ name: Dataform dry run
17
+ entry: hooks/dataform_dry_run.sh
18
+ language: script
19
+ files: (\.sqlx|\.js)$
20
+ pass_filenames: false
hooks/dataform_dry_run.sh
@@ -0,0 +1,22 @@
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
+ if npm i -g @dataform/cli@latest; then
8
+ echo "Dataform installed successfully."
9
+ else
10
+ echo "Failed to install Dataform."
+ exit 1
+ fi
+fi
+dataform install
+dataform run --dry-run
+if [ $? -ne 0 ]; then
+else
21
+ exit 0
22
0 commit comments