-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate.sh
executable file
·68 lines (59 loc) · 1.51 KB
/
generate.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
HEADER=$'/**\n * Generated stub declarations for WP-CLI\n * @see https://wp-cli.org/\n * @see https://github.com/php-stubs/wp-cli-stubs\n */'
FILE="wp-cli-stubs.php"
FILE_PKGS="wp-cli-commands-stubs.php"
FILE_I18N="wp-cli-i18n-stubs.php"
FILE_TOOLS="wp-cli-tools-stubs.php"
set -e
test -f "$FILE"
test -f "$FILE_PKGS"
test -f "$FILE_I18N"
test -d "source/vendor/wp-cli"
# Download dependencies
if [ ! -d vendor ]; then
composer update --no-interaction
fi
# wp-cli/wp-cli
"$(dirname "$0")/vendor/bin/generate-stubs" \
--include-inaccessible-class-nodes \
--force \
--finder=finder.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE"
# Commands
"$(dirname "$0")/vendor/bin/generate-stubs" \
--include-inaccessible-class-nodes \
--force \
--finder=finder-commands.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE_PKGS"
# wp-cli/i18n-command
"$(dirname "$0")/vendor/bin/generate-stubs" \
--include-inaccessible-class-nodes \
--force \
--finder=finder-i18n.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE_I18N"
# wp-cli/php-cli-tools
"$(dirname "$0")/vendor/bin/generate-stubs" \
--include-inaccessible-class-nodes \
--force \
--finder=finder-tools.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE_TOOLS"