File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Generate Posts 2 Posts stubs.
4
+ #
5
+
6
+ PLUGIN_VERSION=" 1.6.5"
7
+
8
+ GENERATE_STUBS_COMMAND=" vendor/bin/generate-stubs"
9
+
10
+ # Check plugin
11
+ if [ ! -r ./posts-to-posts.php ]; then
12
+ echo " Please extract Posts 2 Posts into the current directory!" 1>&2
13
+ echo " wget https://downloads.wordpress.org/plugin/posts-to-posts.${PLUGIN_VERSION} .zip && unzip posts-to-posts.${PLUGIN_VERSION} .zip" 1>&2
14
+ exit 10
15
+ fi
16
+
17
+ rm vendor/scribu/scb-framework/load.php
18
+ sed -e ' /^\/\/ WP/,$d' -i vendor/scribu/lib-posts-to-posts/item-user.php
19
+
20
+ # Generate stubs
21
+ if hash generate-stubs 2> /dev/null; then
22
+ GENERATE_STUBS_COMMAND=" generate-stubs"
23
+ elif hash generate-stubs.phar 2> /dev/null; then
24
+ GENERATE_STUBS_COMMAND=" generate-stubs.phar"
25
+ elif [ ! -x vendor/bin/generate-stubs ]; then
26
+ rm composer.json composer.lock
27
+ composer require --no-interaction --update-no-dev --prefer-dist --ignore-platform-reqs \
28
+ giacocorsiglia/stubs-generator
29
+ fi
30
+
31
+ " $GENERATE_STUBS_COMMAND " --functions --classes --interfaces --traits --out=wp-posts-to-posts-${PLUGIN_VERSION} .php \
32
+ vendor/scribu/scb-framework vendor/scribu/lib-posts-to-posts/ posts-to-posts.php
You can’t perform that action at this time.
0 commit comments