nkakouros-original / ansible-role-nextcloud

An Ansible role to install Nextcloud
GNU General Public License v3.0
11 stars 5 forks source link

Fix regex to lookup version #27

Closed simonspa closed 4 years ago

simonspa commented 4 years ago

If the Nextcloud instance is renamed, let's say to mycloud, the command php occ -V actualy prints

mycloud 17.0.0

Hence, we have to be insensitive to the actual name.

nkakouros commented 4 years ago

I didn't know that. How do you rename nextcloud?

I think the regex would be better like this:

 '[^\s]+ \b\w*\b ?([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}) ?.*',

What are the limitations for the name? If is can only letters/numbers/dashes, we could check for those exactly.

simonspa commented 4 years ago

You it via the theming app, where you can also change logo, color etc. I don't really get why they return that name in the command line, but that's what it is.

The name is a completely free text entry field, so it can contain anything.

nkakouros commented 4 years ago

Thanks for the info. In this case, we could simplify the regex to:

 '.* ([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})$',

If you agree, let's update the PR and merge it!

simonspa commented 4 years ago

Sure, even better. I updated the commit accordingly. :)

nkakouros commented 4 years ago

Great! Thanks for your contributions so far.

simonspa commented 4 years ago

Sure, I'll keep them coming as I move along with my setup - I wholeheartedly agree with your statement in the README that a role shouldn't be doing everything but one thing right...