diff --git a/package.json b/package.json index 75ebb98..0bbd48e 100644 --- a/package.json +++ b/package.json @@ -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 .", diff --git a/src/launcher/launcher.go b/src/launcher/launcher.go index ebe3c5f..109c58b 100644 --- a/src/launcher/launcher.go +++ b/src/launcher/launcher.go @@ -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...") } } \ No newline at end of file