-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add installation request for missing dependencies (bunq/tinker_php#18) #19
Conversation
setup.sh
Outdated
warningMessage=$(printf "${ERROR_COULD_NOT_FIND_COMMAND}" "${programName}" "${!commandInstallationConstantName} ${programPackageName}") | ||
|
||
echo ${warningMessage} >$(tty) | ||
echo "Do you want to try and install this now? (y/N)? " >$(tty) |
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.
Please move this string into a consant.
setup.sh
Outdated
{ | ||
phpModules=$(php -m | head) | ||
|
||
if [[ ${phpModules} != *"curl"* ]]; then |
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.
There are some extension missing according to: composer.json
Aslo this seems like code repeation. Please create a new method:
- isModlueMissing(string[] $allModules, string $moduleToFind): bool
You can do this via:
allModule=$(php -m)
allNeededModule=(some smart way to get a string[] of everthig in composer json)
for line in $allNeededModule; do
if (isModlueMissing($allModule $line)); then
determineInstructionInstallation ...
done
Your method assertComposerPrerequisitePresent
will then loop over each needed and preform the check.
To get all the needed extensions, i would suggest to use the latest composer json on master branch and then run a regex for everything with ext-
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.
Some minor refactoring please
@@ -5,6 +5,8 @@ ERROR_SYSTEM_UNKNOWN='Unknown system found "%s".\n' | |||
ERROR_RUN_IN_EMPTY_DIRECTORY='Please run the script from an empty directory\n' | |||
ERROR_COULD_NOT_FIND_COMMAND='Could not find "%s", try installing it by running "%s".' | |||
|
|||
MESSAGE_INSTALL_DEPENDENCY='Do you want to try and install this now? (y/N)? ' |
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.
Y
@@ -5,6 +5,8 @@ ERROR_SYSTEM_UNKNOWN='Unknown system found "%s".\n' | |||
ERROR_RUN_IN_EMPTY_DIRECTORY='Please run the script from an empty directory\n' | |||
ERROR_COULD_NOT_FIND_COMMAND='Could not find "%s", try installing it by running "%s".' | |||
|
|||
MESSAGE_INSTALL_DEPENDENCY='Do you want to try and install this now? (y/N)? ' |
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.
Y
This PR closes/fixes the following issues: