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

Introduce function to check for utlilities #180

Open
gudmdharalds opened this issue Jun 2, 2021 · 0 comments
Open

Introduce function to check for utlilities #180

gudmdharalds opened this issue Jun 2, 2021 · 0 comments

Comments

@gudmdharalds
Copy link
Contributor

gudmdharalds commented Jun 2, 2021

vip-go-ci uses various utilities, such as git, phpcs, as well as php. What is missing though is a function to check for the existence of such utilities, to ensure that they exist before using them, but in a way that is easy and consistent for developers to implement. The function should support relative and absolute paths.

The function should ideally be able to do such a check in the following ways:

vipgoci_util_exists( '/usr/bin/git', '--version', 'git version', 0 );

And:

vipgoci_util_exists( 'git', '--version', 'git version', 0 );

The parameters are:

  • Path to execute
  • Parameter to add to the command
  • String to look for and expect in the output when executed
  • Expected exit-status of the command

This way one can easily check for the existence of utilities as required. All checks should be performed in vipgoci_run().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant