It could be a shell builtin command or a shell utility command or a Composer command or a Drush command or some combination of commands.

I just want to know what is the current latest stable version of Drupal out there so for example if today this version is 10.2.2 then the output of the CLI command will be something like:

"The latest stable version of Drupal is 10.2.2"

Comments

jaypan’s picture

You can use this: composer show drupal/core --latest | grep 'latest'. Example Output:

latest   : 10.2.2

Contact me to contract me for D7 -> D10/11 migrations.

bendqh1’s picture

Oh I didn't mean what is the latest one installed on my system but what is the latest one out there meaning on the packagist repository or alternatively here on DO.

jaypan’s picture

Yes, that is what I showed you.

Contact me to contract me for D7 -> D10/11 migrations.

bendqh1’s picture

Oh, what confused me is that I ran this command not from my website's directory and then I got this output:

Composer could not find a composer.json file in /home/USERNAME
To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage

But when I ran it from my website's directory I got this output:

latest   : 10.2.2

Funny, I will add a cd "$HOME"/"$web_application_root"/example.com before it !