mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 09:05:46 +00:00
37 lines
869 B
Plaintext
37 lines
869 B
Plaintext
func Tesses.CrossLang.GetNameAndDescription(name)
|
|
{
|
|
var strm = FS.Local.OpenFile(name,"rb");
|
|
var file = VM.LoadExecutable(strm);
|
|
|
|
strm.Close();
|
|
|
|
var name = file.Name;
|
|
|
|
var j = Json.Decode(file.Info);
|
|
var description = TypeOf(j.description) == "String" ? j.description : "";
|
|
|
|
name = TypeOf(j.short_name) == "String" ? j.short_name : name;
|
|
|
|
|
|
return $"{name}: {description}";
|
|
}
|
|
func Tesses.CrossLang.GetNameAndDescriptionJson(name)
|
|
{
|
|
var strm = FS.Local.OpenFile(name,"rb");
|
|
var file = VM.LoadExecutable(strm);
|
|
|
|
strm.Close();
|
|
|
|
var name = file.Name;
|
|
|
|
var j = Json.Decode(file.Info);
|
|
var description = TypeOf(j.description) == "String" ? j.description : "";
|
|
|
|
|
|
name = TypeOf(j.short_name) == "String" ? j.short_name : name;
|
|
|
|
return {
|
|
name,
|
|
description
|
|
};
|
|
} |