mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 17:15:45 +00:00
Adding some documentation to crosslang shell
This commit is contained in:
19
Tesses.CrossLang.BuildEssentials/src/helpers.tcross
Normal file
19
Tesses.CrossLang.BuildEssentials/src/helpers.tcross
Normal file
@@ -0,0 +1,19 @@
|
||||
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 : "";
|
||||
|
||||
if(j.type == "template")
|
||||
name = TypeOf(j.template_name) == "String" ? j.template_name : name;
|
||||
else if(j.type == "tool")
|
||||
name = TypeOf(j.toolname) == "String" ? j.toolname : name;
|
||||
|
||||
return $"{name}: {description}";
|
||||
}
|
||||
Reference in New Issue
Block a user