Skip to content

Commit

Permalink
MetaData -> Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-gd committed Apr 16, 2023
1 parent e95b5c0 commit a478bd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions lua/gpm/packages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -87,7 +87,7 @@ do
PACKAGE = PACKAGE or {}
PACKAGE.__index = PACKAGE

function PACKAGE:GetMetaData()
function PACKAGE:GetMetadata()
return self.metadata
end

Expand Down Expand Up @@ -132,7 +132,6 @@ do

function PACKAGE:GetFileList()
local fileList = {}

for filePath in pairs( self.files ) do
fileList[ #fileList + 1 ] = filePath
end
Expand Down
2 changes: 1 addition & 1 deletion lua/gpm/sources/gmad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions lua/gpm/sources/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a478bd7

Please sign in to comment.