mirror of
https://github.com/r3-team/r3.git
synced 2026-05-06 16:40:25 -05:00
25 lines
483 B
Go
25 lines
483 B
Go
package request
|
|
|
|
import (
|
|
"os"
|
|
"r3/cache"
|
|
"r3/config"
|
|
"r3/tools"
|
|
"r3/transfer"
|
|
)
|
|
|
|
func PackageInstall() (interface{}, error) {
|
|
|
|
// store package file from embedded binary data to temp folder
|
|
filePath, err := tools.GetUniqueFilePath(config.File.Paths.Temp, 8999999, 9999999)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if err := os.WriteFile(filePath, cache.Package_CoreCompany, 0644); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return nil, transfer.ImportFromFiles([]string{filePath})
|
|
}
|