Browse Source

lovr.getVersion includes codename/commit;

bjorn 9 months ago
parent
commit
fecd00dfd6
2 changed files with 19 additions and 1 deletions
  1. 10 0
      api/init.lua
  2. 9 1
      api/lovr/getVersion.lua

+ 10 - 0
api/init.lua

@@ -1089,6 +1089,16 @@ return {
                   name = "patch",
                   type = "number",
                   description = "The patch number."
+                },
+                {
+                  name = "codename",
+                  type = "string",
+                  description = "The version codename."
+                },
+                {
+                  name = "commit",
+                  type = "string",
+                  description = "The commit hash (not available in all builds)."
                 }
               }
             }

+ 9 - 1
api/lovr/getVersion.lua

@@ -15,12 +15,20 @@ return {
     patch = {
       type = 'number',
       description = 'The patch number.'
+    },
+    codename = {
+      type = 'string',
+      description = 'The version codename.'
+    },
+    commit = {
+      type = 'string',
+      description = 'The commit hash (not available in all builds).'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'major', 'minor', 'patch' }
+      returns = { 'major', 'minor', 'patch', 'codename', 'commit' }
     }
   }
 }