Skip to content

Commit 7b1cffe

Browse files
committed
api_refs.sh: Fix Composer authentication
1 parent 8eb3d97 commit 7b1cffe

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tools/api_refs/api_refs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22

3-
set -x;
3+
set +x;
44

5-
AUTH_JSON=${1:-~/.composer/auth.json}; # Path to an auth.json file allowing to install the targeted edition and version
5+
AUTH_JSON=$(realpath "${1:-~/.composer/auth.json}"); # Path to an auth.json file allowing to install the targeted edition and version
66
PHP_API_OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference}; # Path to the directory where the built PHP API Reference is hosted
77
REST_API_OUTPUT_FILE=${3:-./docs/api/rest_api/rest_api_reference/rest_api_reference.html}; # Path to the REST API Reference file
88
REST_API_OPENAPI_FILE_YAML=${4:-./docs/api/rest_api/rest_api_reference/openapi.yaml}; # Path to the REST API OpenAPI spec file
@@ -63,22 +63,22 @@ cd $TMP_DXP_DIR; # /!\ Change working directory (reason why all paths must be ab
6363
if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
6464
echo "Creating ibexa/$DXP_EDITION-skeleton:$DXP_VERSION project in ${TMP_DXP_DIR}";
6565
if [[ "$DXP_VERSION" == *".x-dev" ]]; then
66-
composer create-project ibexa/website-skeleton:$DXP_VERSION . --no-interaction --ignore-platform-reqs --no-scripts --stability=dev;
66+
COMPOSER_AUTH="$(cat $AUTH_JSON | tr -d '\n')" composer create-project ibexa/website-skeleton:$DXP_VERSION . --no-interaction --ignore-platform-reqs --no-scripts --stability=dev;
6767
if [ -n "$AUTH_JSON" ]; then
6868
cp $AUTH_JSON ./;
6969
fi;
7070
composer config repositories.ibexa composer https://updates.ibexa.co;
7171
composer config extra.symfony.endpoint "https://api.github.com/repos/ibexa/recipes-dev/contents/index.json?ref=flex/main";
7272
composer require ibexa/$DXP_EDITION:$DXP_VERSION --no-interaction --update-with-all-dependencies --no-install --ignore-platform-reqs --no-scripts;
7373
elif [[ "$DXP_VERSION" == *"-rc"* ]]; then
74-
composer create-project ibexa/website-skeleton:$DXP_VERSION . --no-interaction --ignore-platform-reqs --no-scripts --stability=rc;
74+
COMPOSER_AUTH="$(cat $AUTH_JSON | tr -d '\n')" composer create-project ibexa/website-skeleton:$DXP_VERSION . --no-interaction --ignore-platform-reqs --no-scripts --stability=rc;
7575
if [ -n "$AUTH_JSON" ]; then
7676
cp $AUTH_JSON ./;
7777
fi;
7878
composer config repositories.ibexa composer https://updates.ibexa.co;
7979
composer require ibexa/$DXP_EDITION:$DXP_VERSION --no-interaction --update-with-all-dependencies --no-install --ignore-platform-reqs --no-scripts;
8080
else
81-
composer create-project ibexa/$DXP_EDITION-skeleton:$DXP_VERSION . --no-interaction --no-install --ignore-platform-reqs --no-scripts;
81+
COMPOSER_AUTH="$(cat $AUTH_JSON | tr -d '\n')" composer create-project ibexa/$DXP_EDITION-skeleton:$DXP_VERSION . --no-interaction --no-install --ignore-platform-reqs --no-scripts;
8282
if [ -n "$AUTH_JSON" ]; then
8383
cp $AUTH_JSON ./;
8484
fi;

0 commit comments

Comments
 (0)