diff --git a/YamlTemplates/template.installer.yaml b/YamlTemplates/template.installer.yaml new file mode 100644 index 0000000..fc29bdc --- /dev/null +++ b/YamlTemplates/template.installer.yaml @@ -0,0 +1,13 @@ +# Created using wingetcreate 1.5.7.0 +# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.5.0.schema.json +{{define "installer"}} +PackageIdentifier: {{.PID}} +PackageVersion: {{.VER}} +InstallerType: {{.TYPE}} +Installers: +- Architecture: x64 + InstallerUrl: {{.URL}} + InstallerSha256: {{.HASH}} +ManifestType: installer +ManifestVersion: 1.6.0 +{{end}} \ No newline at end of file diff --git a/YamlTemplates/template.locale.en-US.yaml b/YamlTemplates/template.locale.en-US.yaml new file mode 100644 index 0000000..a6bc929 --- /dev/null +++ b/YamlTemplates/template.locale.en-US.yaml @@ -0,0 +1,13 @@ +# Created using wingetcreate 1.5.7.0 +# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.5.0.schema.json +{{define "locale"}} +PackageIdentifier: {{.PID}} +PackageVersion: {{.VER}} +PackageLocale: en-US +Publisher: {{.PUB}} +PackageName: {{.NAME}} +License: MIT +ShortDescription: {{.NAME}} +ManifestType: defaultLocale +ManifestVersion: 1.6.0 +{{end}} \ No newline at end of file diff --git a/YamlTemplates/template.yaml b/YamlTemplates/template.yaml new file mode 100644 index 0000000..9f99dc8 --- /dev/null +++ b/YamlTemplates/template.yaml @@ -0,0 +1,9 @@ +# Created using wingetcreate 1.5.7.0 +# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.5.0.schema.json +{{define "yaml"}} +PackageIdentifier: {{.PID}} +PackageVersion: {{.VER}} +DefaultLocale: en-US +ManifestType: version +ManifestVersion: 1.6.0 +{{end}} \ No newline at end of file diff --git a/fileOrginize.go b/fileOrginize.go new file mode 100644 index 0000000..6377f26 --- /dev/null +++ b/fileOrginize.go @@ -0,0 +1,30 @@ +package main + +import ( + "html/template" + "log/slog" + "os" +) + +func CreateDirectoryInPackageDir(doc yaml) { + location := doc.LOCATION + slog.Debug("Creating the Directory: ", location) + direrr := os.MkdirAll(location, 0764) + if direrr != nil { + slog.Error(direrr.Error()) + } +} + +func CreateYaml(doc yaml) { + template, err := template.ParseFiles("YamlTemplates/template.yaml") + yamlFile, _:= os.OpenFile(doc.LOCATION+"/"+doc.PUB+"."+doc.NAME+".yaml", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) + slog.Debug("Create the basic yaml") + if err != nil { + slog.Error(err.Error()) + } + err = template.ExecuteTemplate(yamlFile, "yaml", doc) + if err != nil { + slog.Error(err.Error()) + + } +} diff --git a/html/up.html b/html/up.html index 60dbcdb..582e3ea 100644 --- a/html/up.html +++ b/html/up.html @@ -34,7 +34,7 @@ -