File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 which php || which php-cli || return 1
2222}
2323
24- COMPOSER_DIR=$HOME /.composer
24+ if [ -z $INSTALL_DIR ]; then
25+ INSTALL_DIR=$HOME /.composer
26+ fi
2527
2628# Abort install if wp-cli is already installed via ./utils/dev-build
2729where=$( which wp 2> /dev/null)
2830if [ $? -eq 0 ]; then
29- if [ " $COMPOSER_DIR /bin/wp" != " $where " ]; then
31+ if [ " $INSTALL_DIR /bin/wp" != " $where " ]; then
3032 echo " warning: the \` wp\` command is already available elsewhere: $where " 1>&2
3133 read -p " this installation will not overwrite it. continue? [y/n] " -n 1 -r
3234 echo
5052 }
5153fi
5254
53- mkdir -p $COMPOSER_DIR
54- cd $COMPOSER_DIR
55+ mkdir -p $INSTALL_DIR
56+ cd $INSTALL_DIR
5557
5658# install Composer
5759if [ ! -x composer.phar ]; then
@@ -95,7 +97,7 @@ WP-CLI files have been succesfully installed.
9597
9698To test, run:
9799
98- ~/.composer /bin/wp --info
100+ $INSTALL_DIR /bin/wp --info
99101
100102EOB
101103
You can’t perform that action at this time.
0 commit comments