Skip to content

Commit

Permalink
Set SMARTGIT_JAVA_HOME environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Dec 4, 2018
1 parent a7226d5 commit 0b47251
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 18.2.0-3 (2018/12/04)

* SmartGit 18.2 works only on 64-bits systems
* Set `SMARTGIT_JAVA_HOME` environment variable
* Include our own jre

## 18.2.0-2 (2018/12/01)

* Upgrade to SmartGit 18.2.0
Expand Down
11 changes: 4 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package main

import (
"os"
"runtime"
"strings"

. "github.com/portapps/portapps"
Expand All @@ -17,14 +16,9 @@ func init() {
}

func main() {
smartgitExe := "smartgit32.exe"
if runtime.GOARCH == "amd64" {
smartgitExe = "smartgit.exe"
}

Papp.AppPath = AppPathJoin("app")
Papp.DataPath = CreateFolder(AppPathJoin("data"))
Papp.Process = PathJoin(Papp.AppPath, "bin", smartgitExe)
Papp.Process = PathJoin(Papp.AppPath, "bin", "smartgit.exe")
Papp.Args = nil
Papp.WorkingDir = PathJoin(Papp.AppPath, "bin")

Expand Down Expand Up @@ -54,5 +48,8 @@ func main() {
Log.Errorf("Cannot write system smartgit.vmoptions: %s", err)
}

// set JAVA_HOME
OverrideEnv("SMARTGIT_JAVA_HOME", PathJoin(Papp.AppPath, "jre"))

Launch(os.Args[1:])
}

0 comments on commit 0b47251

Please sign in to comment.