added check for dependencies
This commit is contained in:
parent
430357108c
commit
87ef90c354
1 changed files with 19 additions and 7 deletions
26
main.go
26
main.go
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime" // for detecting system architecture and platform
|
||||
"spitfire/spitfire"
|
||||
|
@ -31,8 +32,8 @@ var (
|
|||
upload bool
|
||||
uploadPath string
|
||||
sourceRepo = "https://hg.mozilla.org/mozilla-central"
|
||||
patchesRepo = "https://weforgecode.xyz/Spitfire/Browser.git"
|
||||
url = "https://spitfirebrowser.com/"
|
||||
patchesRepo = "https://weforge.xyz/Spitfire/Browser.git"
|
||||
url = "https://spitfirebrowser.xyz/"
|
||||
licence = "AGPL-3.0"
|
||||
name = "Spitfire"
|
||||
maintainer = "Internet Addict"
|
||||
|
@ -66,12 +67,18 @@ func printHelp() {
|
|||
os.Exit(0)
|
||||
}
|
||||
|
||||
// checkDependencies verifies if required dependencies are installed
|
||||
func checkDependencies() error {
|
||||
dependencies := []string{"mercurial", "python3", "rsync", "git"}
|
||||
for _, dep := range dependencies {
|
||||
if _, err := exec.LookPath(dep); err != nil {
|
||||
return fmt.Errorf("dependency %s is not installed. Please run: sudo apt install %s", dep, dep)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
// // Check system dependencies
|
||||
// err := spitfire.CheckSystemDependencies()
|
||||
// if err != nil {
|
||||
// log.Fatalf("System check failed: %v", err)
|
||||
// }
|
||||
|
||||
flag.Parse()
|
||||
|
||||
|
@ -79,6 +86,11 @@ func main() {
|
|||
printHelp()
|
||||
}
|
||||
|
||||
// Check system dependencies
|
||||
if err := checkDependencies(); err != nil {
|
||||
log.Fatalf("System check failed: %v", err)
|
||||
}
|
||||
|
||||
// Set version to current date if it's empty and release is nightly
|
||||
if version == "" && release == "nightly" {
|
||||
version = time.Now().Format("2006.01.02") // Set version to current date if nightly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue