diff --git a/lua/gpm/packages.lua b/lua/gpm/packages.lua index a4e31b43..e6b629ba 100644 --- a/lua/gpm/packages.lua +++ b/lua/gpm/packages.lua @@ -35,7 +35,7 @@ function Get( packageName ) return pkgs[ packageName ] end -function GetMetaData( source ) +function GetMetadata( source ) if type( source ) == "table" then -- Package name, main file & author source.name = type( source.name ) == "string" and source.name or nil @@ -74,10 +74,10 @@ function GetMetaData( source ) result = utils.LowerTableKeys( result ) if type( result.package ) ~= "table" then - return GetMetaData( result ) + return GetMetadata( result ) end - return GetMetaData( result.package ) + return GetMetadata( result.package ) end end @@ -87,7 +87,7 @@ do PACKAGE = PACKAGE or {} PACKAGE.__index = PACKAGE - function PACKAGE:GetMetaData() + function PACKAGE:GetMetadata() return self.metadata end @@ -132,7 +132,6 @@ do function PACKAGE:GetFileList() local fileList = {} - for filePath in pairs( self.files ) do fileList[ #fileList + 1 ] = filePath end diff --git a/lua/gpm/sources/gmad.lua b/lua/gpm/sources/gmad.lua index 4cfe0631..c35610c9 100644 --- a/lua/gpm/sources/gmad.lua +++ b/lua/gpm/sources/gmad.lua @@ -57,7 +57,7 @@ Import = promise.Async( function( filePath, parentPackage ) local gma = gmad.Open( filePath, "GAME" ) if not gma then return promise.Reject( "gma file cannot be read" ) end - local metadata = packages.GetMetaData( { + local metadata = packages.GetMetadata( { ["name"] = gma:GetTitle(), ["description"] = gma:GetDescription(), ["author"] = gma:GetAuthor(), diff --git a/lua/gpm/sources/http.lua b/lua/gpm/sources/http.lua index 10a7da7d..d4cae9a7 100644 --- a/lua/gpm/sources/http.lua +++ b/lua/gpm/sources/http.lua @@ -46,7 +46,7 @@ Import = promise.Async( function( url, parentPackage ) local ok, result = fs.Compile( cachePath, "DATA" ):SafeAwait() if not ok then return promise.Reject( result ) end - return packages.Initialize( packages.GetMetaData( { + return packages.Initialize( packages.GetMetadata( { ["name"] = packageName } ), result, {}, parentPackage ) end @@ -66,7 +66,7 @@ Import = promise.Async( function( url, parentPackage ) if not ok then return promise.Reject( result ) end if not result then return promise.Reject( "file compilation failed" ) end - return packages.Initialize( packages.GetMetaData( { + return packages.Initialize( packages.GetMetadata( { ["name"] = packageName } ), result, {}, parentPackage ) end