This repository has been archived on 2023-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
openskins/main.go

44 lines
915 B
Go
Raw Normal View History

2020-12-26 04:16:14 +01:00
package main
import (
"fmt"
"github.com/josephbmanley/OpenSkins/pluginmanager"
log "github.com/sirupsen/logrus"
"os"
"plugin"
2020-12-26 04:16:14 +01:00
)
const plugindirectory = "./plugins"
func main() {
pluginFiles, err := pluginmanager.GetPlugins(plugindirectory)
if err != nil {
log.Warningln(fmt.Sprintf("Failed to read plugins directory: %v", err.Error()))
}
loadedPlugins := []*plugin.Plugin{}
2020-12-26 04:16:14 +01:00
for _, file := range pluginFiles {
log.Infoln(fmt.Sprintf("Loading plugin: %v", file))
plugin, err := plugin.Open(file)
2020-12-26 04:16:14 +01:00
if err != nil {
log.Fatalln(fmt.Sprintf("Failed to load plugin '%v': %v", file, err.Error()))
os.Exit(1)
}
loadedPlugins = append(loadedPlugins, plugin)
2020-12-26 04:16:14 +01:00
}
2020-12-26 04:16:14 +01:00
err = pluginmanager.LoadSkinstores(loadedPlugins)
if err != nil {
log.Fatalln(fmt.Sprintf("Failed to load skinstores '%v'", err.Error()))
os.Exit(1)
2020-12-26 04:16:14 +01:00
}
log.Fatalln("Runtime is currently not implemented!")
os.Exit(1)
2020-12-26 04:16:14 +01:00
}