-
Notifications
You must be signed in to change notification settings - Fork 46
Added small script to test installation on with different dependencies #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/bash | ||
|
|
||
| gethash() { | ||
| if hash md5sum 2>/dev/null; then | ||
| echo -n "$@" | md5sum | awk '{print $1}' | ||
| else | ||
| echo -n "$@" | md5 | awk '{print $1}' | ||
| fi | ||
| } | ||
|
|
||
| HASH=`gethash $@` | ||
| BUILD_DIR=build/`echo ${HASH::7}` | ||
|
|
||
| echo "Using directory: ${BUILD_DIR}" | ||
| # Prepare a folder | ||
| #rm -rf $BUILD_DIR | ||
| mkdir -p $BUILD_DIR | ||
|
|
||
| # Init composer | ||
| composer init --working-dir $BUILD_DIR --no-interaction | ||
| composer req --working-dir $BUILD_DIR php-http/discovery --no-update | ||
|
|
||
| # Define packages from arguments | ||
| composer req --working-dir $BUILD_DIR $3 | ||
|
|
||
| # Copy the current version of php-http/discovery | ||
| cp -R src $BUILD_DIR/vendor/php-http/discovery | ||
| cd $BUILD_DIR | ||
|
|
||
| # Run PHP and check exit code | ||
| php -r "require 'vendor/autoload.php'; ${2}" > /dev/null | ||
| PHP_EXIT_CODE=$? | ||
|
|
||
| # Print result | ||
| echo "" | ||
| echo "" | ||
| if [ $PHP_EXIT_CODE -eq 0 ]; then | ||
| echo "We found a package" | ||
| else | ||
| echo "We did not find anything" | ||
| fi | ||
|
|
||
| echo "" | ||
| if [ "$1" = "will-find" ]; then | ||
| exit $PHP_EXIT_CODE; | ||
| elif [ $PHP_EXIT_CODE -ne 0 ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "We did find a class but we were not supposed to" | ||
| echo "" | ||
| exit 1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we add this as a bash file to tests folder, or
.travisfolder? no big deal, but it seems a bit much for the travis configuration fileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think so. Im not sure how you can "export" a function in bash/travis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see, bash function, not bash script. i guess thats fine then. maybe bash
source-ing the file would work, but i will merge as is and tag another patch release