-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (27 loc) · 756 Bytes
/
main.go
File metadata and controls
35 lines (27 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//go:generate go install -v github.com/josephspurrier/goversioninfo/cmd/goversioninfo
package main
import (
"os"
"path/filepath"
"github.com/portapps/portapps/v3"
"github.com/portapps/portapps/v3/pkg/log"
"github.com/portapps/portapps/v3/pkg/utl"
)
var (
app *portapps.App
)
func init() {
var err error
// Init app
if app, err = portapps.New("qbittorrent-portable", "qBittorrent"); err != nil {
log.Fatal().Err(err).Msg("Cannot initialize application. See log file for more info.")
}
}
func main() {
utl.CreateFolder(app.DataPath)
app.Process = filepath.Join(app.AppPath, "qbittorrent.exe")
profilePath := utl.CreateFolder(app.DataPath, "profile")
os.Setenv("QBT_PROFILE", profilePath)
defer app.Close()
app.Launch(os.Args[1:])
}