Compare commits
28 Commits
15e317b6fe
..
v1.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 23287c7c6c | |||
| 5b2affec8d | |||
| d252e8e8d9 | |||
| 9e493e68d8 | |||
| b898338b2d | |||
| ba986af8a8 | |||
| c1885f174a | |||
| 0650dabb15 | |||
| 42af2d6d25 | |||
| 2dbc72bd39 | |||
| d46a142312 | |||
| caa699c651 | |||
| c5f77582c0 | |||
| 06503ce518 | |||
| f1603dc6fa | |||
| f8932166bb | |||
| ffd41348a0 | |||
| 12a9c101f2 | |||
| ff6381575e | |||
| acb4401e37 | |||
| 76d8c1744a | |||
| b2bef77f09 | |||
| 4cbb0666cb | |||
| 83cb34001f | |||
| 1f09482950 | |||
| 1af4d225b5 | |||
| 7863c53280 | |||
| 35d888ec62 |
@@ -5,8 +5,6 @@ on:
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -19,18 +17,21 @@ jobs:
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: latest
|
||||
version: v2.13.2
|
||||
|
||||
test:
|
||||
name: Test
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -61,8 +62,6 @@ jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -90,7 +89,7 @@ jobs:
|
||||
|
||||
- name: Build for linux
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
@@ -102,7 +101,7 @@ jobs:
|
||||
|
||||
- name: Build for windows
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
@@ -115,5 +114,5 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: swiped-mod-switcher-${{github.ref_name}}
|
||||
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||
path: bin/
|
||||
@@ -6,13 +6,14 @@ on:
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: test log
|
||||
run: env | sort
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
@@ -20,18 +21,21 @@ jobs:
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: latest
|
||||
version: v2.13.2
|
||||
|
||||
test:
|
||||
name: Test
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -62,8 +66,6 @@ jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -91,7 +93,7 @@ jobs:
|
||||
|
||||
- name: Build for linux
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}
|
||||
ls bin
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
@@ -103,7 +105,7 @@ jobs:
|
||||
|
||||
- name: Build for windows
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
ls bin
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
@@ -116,5 +118,5 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: swiped-mod-switcher-${{github.ref_name}}
|
||||
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||
path: bin/
|
||||
@@ -7,8 +7,6 @@ on:
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -21,18 +19,22 @@ jobs:
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: latest
|
||||
version: v2.13.2
|
||||
args: --timeout=5m
|
||||
|
||||
test:
|
||||
name: Test
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -63,7 +65,10 @@ jobs:
|
||||
|
||||
release:
|
||||
name: Build versioned release
|
||||
needs: [lint, test]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -87,7 +92,7 @@ jobs:
|
||||
|
||||
- name: Build for linux
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
|
||||
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
@@ -99,7 +104,7 @@ jobs:
|
||||
|
||||
- name: Build for windows
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata Build=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
@@ -109,9 +114,16 @@ jobs:
|
||||
CGO_ENABLED: 1
|
||||
CC: x86_64-w64-mingw32-gcc
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||
path: bin/
|
||||
|
||||
# Prefer built-in job token (Eva): gitea-release-action@v1 defaults to
|
||||
# github.token / GITEA_TOKEN — no RELEASE_TOKEN / GIT_PACKAGES_TOKEN.
|
||||
- name: Release binaries
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||
with:
|
||||
files: |-
|
||||
bin/**
|
||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# .golangci.yml — SwipedModSwitcher (golangci-lint v2)
|
||||
# Adapted from steamcache2 v2 skeleton; no project-specific path excludes yet.
|
||||
# Run with: golangci-lint run ./...
|
||||
version: "2"
|
||||
|
||||
run:
|
||||
timeout: 5m
|
||||
modules-download-mode: readonly
|
||||
|
||||
linters:
|
||||
# Defaults (errcheck, govet, ineffassign, staticcheck, unused, …) plus:
|
||||
enable:
|
||||
- misspell
|
||||
settings:
|
||||
errcheck:
|
||||
check-type-assertions: false
|
||||
check-blank: false
|
||||
staticcheck:
|
||||
checks:
|
||||
- all
|
||||
- "-ST*"
|
||||
- "-QF*"
|
||||
govet:
|
||||
enable-all: true
|
||||
disable:
|
||||
- fieldalignment
|
||||
- shadow
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- dist
|
||||
- bin
|
||||
rules:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- errcheck
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- goimports
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- dist
|
||||
- bin
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
@@ -0,0 +1,44 @@
|
||||
# Contributing
|
||||
|
||||
## Propose changes
|
||||
|
||||
Open a pull request against `develop`. Keep the default branch for releases and
|
||||
stable tips; land work on `develop` first.
|
||||
|
||||
Point at an existing issue when one fits. Prefer a short issue that states the
|
||||
symptom or request before a large PR.
|
||||
|
||||
## Commits
|
||||
|
||||
Subject form:
|
||||
|
||||
```
|
||||
area: Imperative summary
|
||||
```
|
||||
|
||||
- **Area** is a real package, directory, or subsystem token (`ci:`, `docs:`,
|
||||
Go package name). Not a lone filename.
|
||||
- **Imperative** mood: Fix, Add, Remove — not "Fixed" or "This patch…".
|
||||
- No trailing period. Aim ≤ ~70–75 characters for the whole subject.
|
||||
- Not conventional-commits (`feat:` / `fix:` / `chore:` as types).
|
||||
|
||||
Body explains **why**. Establish the problem, then say what you are doing.
|
||||
One logical change per commit; split fix and cleanup.
|
||||
|
||||
## Pull requests
|
||||
|
||||
Title matches the primary commit subject.
|
||||
|
||||
- **What** changed
|
||||
- **Why** (problem and impact)
|
||||
- **Test** (concrete steps; "CI green" alone is weak)
|
||||
|
||||
## Issues and closing
|
||||
|
||||
Cite leftover issues by **full URL**. Gitea closes issues when `#N` appears in
|
||||
merge text, so do not put `#N` in the merge message unless that issue is actually
|
||||
done. Use `Fixes #N` / `Closes #N` only when the leftover work is finished.
|
||||
|
||||
## License
|
||||
|
||||
License TBD by owner.
|
||||
@@ -2,5 +2,3 @@
|
||||
Icon = "icon.png"
|
||||
Name = "Swiped Mod Switcher"
|
||||
ID = "com.s1d3sw1ped.swipedmodswitcher"
|
||||
Version = "0.0.0"
|
||||
Build = 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Swiped Mod Switcher
|
||||
A simple but effective mod switcher for simple game such as Sims and Cyberpunk 2077.
|
||||
A simple but effective mod switcher for simple game such as Sims.
|
||||
|
||||
it works by switching out a games mod folder with one of the ones made by you and placed under the profiles directory.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module s1d3sw1ped/swipedmodswitcher
|
||||
|
||||
go 1.22
|
||||
go 1.27.0
|
||||
|
||||
require (
|
||||
fyne.io/fyne/v2 v2.3.5
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"s1d3sw1ped/swipedmodswitcher/admin"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@@ -18,8 +18,6 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
var Version = ""
|
||||
|
||||
type Config struct {
|
||||
ModProfilesDirectory string `yaml:"mod_profiles_dir"`
|
||||
GameModsDirectory string `yaml:"game_mods_dir"`
|
||||
@@ -74,7 +72,31 @@ func main() {
|
||||
cfg = loadConfig()
|
||||
|
||||
ap := app.New()
|
||||
wp := ap.NewWindow(ap.Metadata().Name + " v" + ap.Metadata().Version + "." + strconv.Itoa(ap.Metadata().Build))
|
||||
|
||||
commithash := func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
for _, setting := range info.Settings {
|
||||
if setting.Key == "vcs.revision" {
|
||||
return setting.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}()
|
||||
|
||||
buildversion := ap.Metadata().Custom["BuildVersion"]
|
||||
if buildversion == "" {
|
||||
buildversion = ""
|
||||
}
|
||||
|
||||
buildnumber := ap.Metadata().Custom["BuildNumber"]
|
||||
if buildnumber == "" {
|
||||
buildnumber = "commit " + commithash
|
||||
} else {
|
||||
buildnumber = "build " + buildnumber
|
||||
}
|
||||
|
||||
wp := ap.NewWindow(ap.Metadata().Name + " " + buildversion + " " + buildnumber)
|
||||
wp.Resize(fyne.NewSize(600, 1))
|
||||
wp.CenterOnScreen()
|
||||
|
||||
@@ -189,6 +211,6 @@ func makeIFunc(profile, archive string, parent fyne.Window) func() {
|
||||
return
|
||||
}
|
||||
|
||||
dialog.NewInformation("Success", fmt.Sprintf("filinked files from %s to %s", filepath.Base(profile), archive), parent).Show()
|
||||
dialog.NewInformation("Success", fmt.Sprintf("linked files from %s to %s", filepath.Base(profile), archive), parent).Show()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user