[release] v0.17.0-unstable20

This commit is contained in:
Yann Stepienik
2024-10-29 19:28:19 +00:00
parent ad767208c3
commit 12c38562ea
2 changed files with 10 additions and 5 deletions

View File

@@ -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 .",

View File

@@ -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...")
}
}