Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

Crecket
Copy link

@Crecket Crecket commented May 8, 2018

This PR closes/fixes the following issues:

@OGKevin OGKevin self-requested a review May 9, 2018 05:11
@OGKevin OGKevin added the enhancement New feature or request label May 9, 2018
@OGKevin OGKevin added this to the 0.9.3 milestone May 9, 2018
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)
Copy link
Contributor

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
Copy link
Contributor

@OGKevin OGKevin May 9, 2018

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:

  1. 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-

Copy link
Contributor

@OGKevin OGKevin left a 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)? '

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)? '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can be merged enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add installation request for required dependencies
3 participants