-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·31 lines (23 loc) · 709 Bytes
/
generate.sh
File metadata and controls
executable file
·31 lines (23 loc) · 709 Bytes
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
#!/usr/bin/env bash
HEADER=$'/**\n * Generated stub declarations for Gravity Forms\n * @see https://www.gravityforms.com/\n * @see https://github.com/php-stubs/gravity-forms-stubs\n */'
FILE="gravity-forms-stubs.php"
set -e
test -f "$FILE"
test -d "source/gravityforms"
# Download dependencies
if [ ! -d vendor ]; then
composer update
fi
# Rename one of the two rgar functions
sed -i -e 's#^\(\s*function \)\(rgar(.*\)$#\1__\2#' source/gravityforms/xml.php
"$(dirname "$0")/vendor/bin/generate-stubs" \
--force \
--finder=finder.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE"
# Remove CR characters
dos2unix -k "$FILE"