mirror of
https://github.com/azukaar/Cosmos-Server.git
synced 2026-01-06 04:09:53 -06:00
[release] v0.17.0-unstable20
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.17.0-unstable19",
|
||||
"version": "0.17.0-unstable20",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
@@ -89,7 +89,7 @@
|
||||
"scripts": {
|
||||
"client": "vite",
|
||||
"client-build": "vite build --base=/cosmos-ui/",
|
||||
"start": "env COSMOS_CONFIG_FOLDER=./zz_test_config/ CONFIG_FILE=./config_dev.json EZ=UTC ACME_STAGING=true build/cosmos",
|
||||
"start": "build/cosmos-launcher && env COSMOS_CONFIG_FOLDER=./zz_test_config/ CONFIG_FILE=./config_dev.json EZ=UTC ACME_STAGING=true build/cosmos",
|
||||
"build": "sh build.sh",
|
||||
"dev": "npm run build && npm run start",
|
||||
"dockerdevbuild": "docker build -f dockerfile.local --tag cosmos-dev .",
|
||||
|
||||
@@ -98,7 +98,8 @@ func unzip(src string, dest string) error {
|
||||
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, World!")
|
||||
fmt.Println("-- Cosmos Cloud Launcher --")
|
||||
fmt.Println("Checking for updates to install...")
|
||||
|
||||
execPath, err := os.Executable()
|
||||
if err != nil {
|
||||
@@ -113,7 +114,7 @@ func main() {
|
||||
|
||||
// if there's no updates
|
||||
if _, err := os.Stat(dlPath); err != nil {
|
||||
fmt.Println("No update available")
|
||||
fmt.Println("No updates to install, starting Cosmos...")
|
||||
// start cosmos
|
||||
// TODO
|
||||
}
|
||||
@@ -137,6 +138,7 @@ func main() {
|
||||
|
||||
// check md5
|
||||
if hash != "" {
|
||||
fmt.Println("Update found, checking MD5 hash...")
|
||||
file, err := os.Open(dlPath)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
@@ -151,13 +153,14 @@ func main() {
|
||||
}
|
||||
|
||||
if hash != hex.EncodeToString(hasher.Sum(nil)) {
|
||||
fmt.Println("MD5 mismatch - aborting update")
|
||||
fmt.Println("[ERROR] MD5 mismatch - aborting update!")
|
||||
// delete the file
|
||||
os.Remove(dlPath)
|
||||
return
|
||||
}
|
||||
|
||||
// extract the file
|
||||
fmt.Println("MD5 hash matches, extracting update...")
|
||||
err = unzip(dlPath, currentFolder)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
@@ -166,5 +169,7 @@ func main() {
|
||||
|
||||
// delete the file
|
||||
os.Remove(dlPath)
|
||||
|
||||
fmt.Println("Update complete, starting Cosmos...")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user