mirror of
https://github.com/starship/starship
synced 2024-11-02 04:08:02 +00:00
Fix PHP version including error messages (#1317)
PHP will output error messages when displaying the version if, for example, there is something wrong with the local `php.ini` file. Have updated the command used to get the PHP version to only use the default PHP config.
This commit is contained in:
parent
6ecabdfee4
commit
c182572796
2 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||||
match utils::exec_cmd(
|
match utils::exec_cmd(
|
||||||
"php",
|
"php",
|
||||||
&[
|
&[
|
||||||
"-r",
|
"-nr",
|
||||||
"echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;",
|
"echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;",
|
||||||
],
|
],
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ active boot switches: -d:release\n",
|
||||||
stdout: String::from("4.10.0"),
|
stdout: String::from("4.10.0"),
|
||||||
stderr: String::default(),
|
stderr: String::default(),
|
||||||
}),
|
}),
|
||||||
"php -r echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;" => {
|
"php -nr echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;" => {
|
||||||
Some(CommandOutput {
|
Some(CommandOutput {
|
||||||
stdout: String::from("7.3.8"),
|
stdout: String::from("7.3.8"),
|
||||||
stderr: String::default(),
|
stderr: String::default(),
|
||||||
|
|
Loading…
Reference in a new issue