now InstallPackage function from packets package don't try to read a config.toml, it get the path to install by a param; added async dependency install process

This commit is contained in:
2025-09-21 22:52:03 -03:00
parent f34308367e
commit ff986ef943
3 changed files with 148 additions and 21 deletions

View File

@@ -8,10 +8,10 @@ import (
"fmt"
"io"
"os"
"packets/configs"
"packets/internal/consts"
errors_packets "packets/internal/errors"
"packets/internal/utils"
utils_lua "packets/internal/utils/lua"
"path"
"path/filepath"
@@ -23,22 +23,13 @@ import (
)
// Install exctract and fully install from a package file ( tar.zst )
func InstallPackage(file io.Reader) error {
func InstallPackage(file io.Reader, destDir string) error {
manifest, err := utils.ReadManifest(file)
if err != nil {
return err
}
name := manifest.Info.Name
configuration, err := configs.GetConfigTOML()
if err != nil {
return err
}
destDir := filepath.Join(configuration.Config.Data_d, name)
zstdReader, err := zstd.NewReader(file)
if err != nil {
return err