Skip to content

Commit

Permalink
Merge pull request #184 from palantirnet/fix-installer-dirname-error
Browse files Browse the repository at this point in the history
Fix shell script installer
  • Loading branch information
becw authored Mar 24, 2022
2 parents e4b49e2 + 4abdde6 commit 451337d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
name: Configure PHP
command: |
echo "sendmail_path=/bin/true" | sudo tee -a "/etc/php.d/circleci.ini"
- run:
name: Update Composer
command: |
sudo composer self-update
- run:
name: Create artifacts directory
command: mkdir /tmp/artifacts
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ _Note: If you are starting a new a project, you may be looking for the [drupal-s
$> composer require palantirnet/the-build
```

Composer 2.2.2 or greater is required for the-build.

## Setting up

Install the default templates and phing targets to your project:
Expand Down
25 changes: 11 additions & 14 deletions bin/the-build-installer
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
#!/bin/sh
#
# Wrapper for our install command; at least this way it's somewhat discoverable.
# Previously:
#
# The install command boils down to:
# vendor/bin/phing -f vendor/palantirnet/the-build/targets/install.xml
#
# * This script requires Composer 2.2.2 or greater, because of a series of script proxying
# changes between 2.1.x and 2.2.2. This requirement is enforced in composer.json.
# * This script assumes the composer bin dir is at vendor/bin/

# Relative path to this script.
SCRIPT=$(readlink "$0")

# Absolute path to this script's parent directory.
SCRIPTPATH=$(cd `dirname $0` && cd `dirname $SCRIPT` && pwd)

REPOPATH=$(cd `dirname $SCRIPTPATH` && cd ../../../ && pwd)

if [ "$REPOPATH" = `pwd` ]; then
# Run our install task.
$SCRIPTPATH/../../../bin/phing -f $SCRIPTPATH/../targets/install.xml
else
echo "Please run this command from your project root."
# Composer 2.2.2 through 2.2.6
if [ "$COMPOSER_BIN_DIR" != "" ]; then
COMPOSER_RUNTIME_BIN_DIR="$COMPOSER_BIN_DIR"
fi

(cd $COMPOSER_RUNTIME_BIN_DIR/../../ && $COMPOSER_RUNTIME_BIN_DIR/phing -f $COMPOSER_RUNTIME_BIN_DIR/../palantirnet/the-build/targets/install.xml)
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"bin/the-build-installer"
],
"require": {
"composer-runtime-api": "^2.2.2",
"cweagans/composer-patches": "^1.7",
"drupal/coder": "^8.3.6",
"drush/drush": "^9 || ^10",
Expand All @@ -29,7 +30,11 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cweagans/composer-patches": true
}
},
"extra": {
"patches": {
Expand Down
4 changes: 4 additions & 0 deletions defaults/install/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
name: Configure PHP
command: |
echo "sendmail_path=/bin/true" | sudo tee -a "/etc/php.d/circleci.ini"
- run:
name: Update Composer
command: |
sudo composer self-update
- run:
name: Create artifacts directory
command: mkdir /tmp/artifacts
Expand Down

0 comments on commit 451337d

Please sign in to comment.