Skip to content

Commit 4714da8

Browse files
Merge pull request wp-cli#12 from wp-cli/custom-installer-path
Custom installer path
2 parents b53f9ef + e191b26 commit 4714da8

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

installer.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ EOB
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
2729
where=$(which wp 2>/dev/null)
2830
if [ $? -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
@@ -50,8 +52,8 @@ else
5052
}
5153
fi
5254

53-
mkdir -p $COMPOSER_DIR
54-
cd $COMPOSER_DIR
55+
mkdir -p $INSTALL_DIR
56+
cd $INSTALL_DIR
5557

5658
# install Composer
5759
if [ ! -x composer.phar ]; then
@@ -95,7 +97,7 @@ WP-CLI files have been succesfully installed.
9597
9698
To test, run:
9799
98-
~/.composer/bin/wp --info
100+
$INSTALL_DIR/bin/wp --info
99101
100102
EOB
101103

0 commit comments

Comments
 (0)