renpy2linux icon indicating copy to clipboard operation
renpy2linux copied to clipboard

A way to automate finding the Ren'Py version.

Open Uradamus opened this issue 7 years ago • 1 comments

Looking around a bit, I found that you can get the version number from the ./renpy/__init__.py file in the game's directory. It's declared as a tuple along the lines of:

version_tuple = (6, 99, 11, vc_version)

Only the first 3 parts are relevant and they could be grabbed with a code snippet like this:

RENPYVER=grep "^version_tuple =" renpy/__init__.py | awk '{for(i=1;i<NF;i++){match($i,/[0-9]+/);if(RLENGTH!=-1){if(length(r)>0){r=r "."};r=r substr($i,RSTART,RLENGTH)}};print r}'

Uradamus avatar Jun 17 '18 05:06 Uradamus

looks like the issue tracker decided to interpret the double underscores before and after init to mean I wanted bold text... Ok, found out how to do unformatted text, everything looks proper now.

Uradamus avatar Jun 17 '18 07:06 Uradamus