Compare commits

...

22 Commits

Author SHA1 Message Date
s1d3sw1ped
35d888ec62 Merge pull request 'merge master into develop' (#22) from master into develop
All checks were successful
CI / Lint (push) Successful in 1m10s
CI / Test (push) Successful in 3m38s
CI / Build (push) Successful in 4m9s
Reviewed-on: #22
2024-03-12 05:16:43 +00:00
s1d3sw1ped
15e317b6fe Merge pull request 'fix' (#21) from fix3 into master
All checks were successful
CI / Lint (push) Successful in 50s
CI / Test (push) Successful in 3m32s
CI / Build (push) Successful in 4m4s
CI / Lint (pull_request) Successful in 1m2s
CI / Test (pull_request) Successful in 3m46s
CI / Build (pull_request) Successful in 4m18s
Reviewed-on: #21
2024-03-12 05:03:56 +00:00
07f11c7d22 fix
Some checks failed
CI / Build (pull_request) Has been cancelled
CI / Test (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
2024-03-12 00:03:21 -05:00
s1d3sw1ped
7c28081b65 Merge pull request 'fix' (#20) from fix2 into master
All checks were successful
CI / Lint (push) Successful in 40s
CI / Build (push) Successful in 3m22s
CI / Test (push) Successful in 3m42s
Reviewed-on: #20
2024-03-12 04:56:40 +00:00
d9a75a5e21 fix
Some checks failed
CI / Test (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
2024-03-11 23:56:22 -05:00
s1d3sw1ped
5da6636dd7 Merge pull request 'blah' (#19) from fix into master
All checks were successful
CI / Lint (push) Successful in 55s
CI / Test (push) Successful in 3m45s
CI / Build (push) Successful in 4m16s
Reviewed-on: #19
2024-03-12 04:40:10 +00:00
b04e653350 blah
Some checks failed
CI / Test (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
2024-03-11 23:39:24 -05:00
s1d3sw1ped
8469610328 Merge pull request 'ci and general changes' (#18) from ci_and_edits into master
All checks were successful
CI / Lint (push) Successful in 46s
CI / Build (push) Successful in 3m36s
CI / Test (push) Successful in 4m7s
Reviewed-on: #18
2024-03-12 04:06:14 +00:00
9703682b4a try fixing ci again
All checks were successful
CI / Lint (pull_request) Successful in 54s
CI / Build (pull_request) Successful in 3m35s
CI / Test (pull_request) Successful in 4m0s
2024-03-11 21:59:14 -05:00
e281fbafdb ci and general changes
All checks were successful
CI / Lint (pull_request) Successful in 50s
CI / Build (pull_request) Successful in 3m46s
CI / Test (pull_request) Successful in 4m6s
2024-03-11 21:42:16 -05:00
be35430727 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 3m2s
2024-03-11 14:09:01 -05:00
3667bfae52 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 3m12s
2024-03-11 14:01:07 -05:00
8ec9119bc1 please
All checks were successful
CI / Lint (push) Successful in 56s
CI / Test (push) Successful in 3m43s
CI / Build (push) Successful in 4m20s
2024-03-11 12:46:27 -05:00
4924466a93 please
Some checks failed
CI / Lint (push) Successful in 53s
CI / Test (push) Successful in 3m5s
CI / Build (push) Failing after 1m56s
2024-03-11 11:45:17 -05:00
e37e629630 please
Some checks failed
CI / Lint (push) Successful in 49s
CI / Build (push) Failing after 3m2s
CI / Test (push) Successful in 3m32s
2024-03-10 22:08:51 -05:00
e1db654a48 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 2m56s
2024-03-10 22:00:02 -05:00
ee19aadac9 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Failing after 1m58s
2024-03-10 21:56:40 -05:00
17b0d9f72e please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 3m2s
2024-03-10 21:46:47 -05:00
99a59b47c2 please
Some checks failed
CI / Lint (push) Successful in 48s
CI / Build (push) Failing after 2m48s
CI / Test (push) Successful in 3m18s
2024-03-10 21:41:26 -05:00
77f83b89f6 Merge branch 'master' of ssh://git.s1d3sw1ped.com:2222/s1d3sw1ped/SwipedModSwitcher
All checks were successful
CI / Lint (push) Successful in 56s
CI / Build (push) Successful in 3m12s
CI / Test (push) Successful in 3m37s
2024-03-10 21:23:53 -05:00
s1d3sw1ped
86d4095444 Merge pull request 'cleanup' (#17) from develop into master
All checks were successful
CI / Lint (push) Successful in 48s
CI / Build (push) Successful in 3m0s
CI / Test (push) Successful in 3m20s
Reviewed-on: #17
2024-03-11 02:04:57 +00:00
58bb19b43f add actions 2024-03-10 00:41:03 -06:00
5 changed files with 28 additions and 20 deletions

View File

@@ -90,8 +90,9 @@ jobs:
- name: Build for linux - name: Build for linux
run: | run: |
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
env: env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
GOOS: linux GOOS: linux
GOARCH: amd64 GOARCH: amd64
@@ -101,12 +102,13 @@ jobs:
- name: Build for windows - name: Build for windows
run: | run: |
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
env: env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
GOOS: windows GOOS: windows
GOARCH: amd64 GOARCH: amd64
EXE: .exe EXE: ".exe"
CGO_ENABLED: 1 CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc CC: x86_64-w64-mingw32-gcc

View File

@@ -91,25 +91,25 @@ jobs:
- name: Build for linux - name: Build for linux
run: | run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
ls bin
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
GOOS: linux GOOS: linux
GOARCH: amd64 GOARCH: amd64
EXE: ""
CGO_ENABLED: 1 CGO_ENABLED: 1
CC: gcc CC: gcc
- name: Build for windows - name: Build for windows
run: | run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
ls bin
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
GOOS: windows GOOS: windows
GOARCH: amd64 GOARCH: amd64
EXE: .exe
CGO_ENABLED: 1 CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc CC: x86_64-w64-mingw32-gcc

View File

@@ -87,7 +87,7 @@ jobs:
- name: Build for linux - name: Build for linux
run: | run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
@@ -97,10 +97,9 @@ jobs:
CGO_ENABLED: 1 CGO_ENABLED: 1
CC: gcc CC: gcc
- name: Build for windows - name: Build for windows
run: | run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
env: env:
VERSION: ${{github.ref_name}} VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}} BUILD: ${{github.run_number}}
@@ -110,7 +109,6 @@ jobs:
CGO_ENABLED: 1 CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc CC: x86_64-w64-mingw32-gcc
- name: Release binaries - name: Release binaries
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main
with: with:

View File

@@ -3,4 +3,4 @@ Icon = "icon.png"
Name = "Swiped Mod Switcher" Name = "Swiped Mod Switcher"
ID = "com.s1d3sw1ped.swipedmodswitcher" ID = "com.s1d3sw1ped.swipedmodswitcher"
Version = "0.0.0" Version = "0.0.0"
Build = 1 Build = 2

View File

@@ -18,6 +18,8 @@ import (
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
) )
var Version = ""
type Config struct { type Config struct {
ModProfilesDirectory string `yaml:"mod_profiles_dir"` ModProfilesDirectory string `yaml:"mod_profiles_dir"`
GameModsDirectory string `yaml:"game_mods_dir"` GameModsDirectory string `yaml:"game_mods_dir"`
@@ -61,10 +63,12 @@ var cfg *Config
func main() { func main() {
if !admin.Admin() { if !admin.Admin() {
fmt.Println("not running as administrator relaunching")
if err := admin.RunSelfElevated(); err != nil { if err := admin.RunSelfElevated(); err != nil {
panic(err) panic(err)
} }
os.Exit(0) os.Exit(0)
return // just incase
} }
cfg = loadConfig() cfg = loadConfig()
@@ -136,10 +140,14 @@ func fillGrid(grid *fyne.Container, parent fyne.Window) {
grid.Hide() grid.Hide()
defer grid.Show() defer grid.Show()
grid.RemoveAll() grid.RemoveAll()
if admin.Admin() {
for _, profile := range profiles { for _, profile := range profiles {
profilename := filepath.Base(profile) profilename := filepath.Base(profile)
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent))) grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
} }
} else {
grid.Add(widget.NewLabel("not running as administrator"))
}
} }
func scanProfiles(profilesroot string) []string { func scanProfiles(profilesroot string) []string {