Skip to content

Commit 8113c7e

Browse files
authored
Merge pull request #672 from yorukot/1.2.0.0-release
chore(release): 1.2.0.0 release
2 parents 34fd3e6 + 3a7375f commit 8113c7e

File tree

14 files changed

+270
-19
lines changed

14 files changed

+270
-19
lines changed

changelog.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,67 @@
22

33
All notable changes to this project will be documented in this file. Dates are displayed in UTC(YYYY-MM-DD).
44

5+
# [**v1.2.0.0**](https://github.com/yorukot/superfile/releases/tag/v1.2.0.0)
6+
7+
> 2025-03-05
8+
9+
#### Update
10+
- Added direnv support for nix flake dev shell [`#568`](https://github.com/yorukot/superfile/pull/568)
11+
- Move rename cursor to start before the extension [`#565`](https://github.com/yorukot/superfile/pull/565)
12+
- Renaming feature for pinned directories [`#579`](https://github.com/yorukot/superfile/pull/579)
13+
- Add python testsuite [`#581`](https://github.com/yorukot/superfile/pull/581)
14+
- Add build instructions for windows [`#583`](https://github.com/yorukot/superfile/pull/583)
15+
- Add `--config-file` flag support [`#592`](https://github.com/yorukot/superfile/pull/592)
16+
- Document Windows scoop installation option [`#595`](https://github.com/yorukot/superfile/pull/595)
17+
- Rotate image using EXIF metadata [`#607`](https://github.com/yorukot/superfile/pull/607)
18+
- Upgrade sidebar search [`#614`](https://github.com/yorukot/superfile/pull/614)
19+
- Change all outPutLog to slog.Error or slog.Info [`#628`](https://github.com/yorukot/superfile/pull/628)
20+
- Add install.sh files link for more trust [`#645`](https://github.com/yorukot/superfile/pull/645)
21+
- Update README.md and added a Run the app title [`#550`](https://github.com/yorukot/superfile/pull/550)
22+
23+
#### Bug fix
24+
- Fix sort options hotkey [`#548`](https://github.com/yorukot/superfile/pull/548)
25+
- Fix wrong log line, Fatalln was used with formatting verbs [`#555`](https://github.com/yorukot/superfile/pull/555)
26+
- Fix incorrect failure reporting in delete operation [`#558`](https://github.com/yorukot/superfile/pull/558)
27+
- Fix previews for text file with control characters [`#557`](https://github.com/yorukot/superfile/pull/557)
28+
- Fix search field key blocking [`#569`](https://github.com/yorukot/superfile/pull/569)
29+
- Fix windows operations and other improvements [`#564`](https://github.com/yorukot/superfile/pull/564)
30+
- Fix crash when searching on WSL mounted drives [`#576`](https://github.com/yorukot/superfile/pull/576)
31+
- Fix arch install instructions [`#580`](https://github.com/yorukot/superfile/pull/580)
32+
- Fix windows delete, open file and other improvements [`#584`](https://github.com/yorukot/superfile/pull/584)
33+
- Fix UI issue of spf stuck with terminal size too small [`#594`](https://github.com/yorukot/superfile/pull/594)
34+
- Fix wrong path separator in windows [`#597`](https://github.com/yorukot/superfile/pull/597)
35+
- Fix command line not working for windows [`#601`](https://github.com/yorukot/superfile/pull/601)
36+
- Fix error while reading last check version file in new time zone [`#634`](https://github.com/yorukot/superfile/pull/634)
37+
- Fix discrete timeout for HTTP get version [`#632`](https://github.com/yorukot/superfile/pull/632)
38+
- Fix initial pinned.json having invalid JSON [`#652`](https://github.com/yorukot/superfile/pull/652)
39+
- Fix loadConfigFile and loadHotkeysFile functions [`#650`](https://github.com/yorukot/superfile/pull/650)
40+
- Fix issue when trying to extract a file with .zip_ extension [`#636`](https://github.com/yorukot/superfile/pull/636)
41+
- Fix openFileWithEditor bug [`#635`](https://github.com/yorukot/superfile/pull/635)
42+
- Fix partial overwrite issue by ensuring full file rewrite [`#665`](https://github.com/yorukot/superfile/pull/665)
43+
44+
#### Optimization
45+
- Improving file panel rendering [`#589`](https://github.com/yorukot/superfile/pull/589)
46+
- Improve formatting, error handling, and fix typos [`#600`](https://github.com/yorukot/superfile/pull/600)
47+
- Go formatting fixes [`#618`](https://github.com/yorukot/superfile/pull/618)
48+
- Testsuite in GitHub Actions [`#602`](https://github.com/yorukot/superfile/pull/602)
49+
50+
#### Documentation
51+
- Revert changes in website that were not yet released [`#611`](https://github.com/yorukot/superfile/pull/611)
52+
- Docs contribute [`#610`](https://github.com/yorukot/superfile/pull/610)
53+
- Remove godocs badge [`#627`](https://github.com/yorukot/superfile/pull/627)
54+
- Update installation.md to note setting nerd-font in terminal application [`#658`](https://github.com/yorukot/superfile/pull/658)
55+
- Fix README typos [`#653`](https://github.com/yorukot/superfile/pull/653)
56+
57+
# [**v1.1.7.1**](https://github.com/yorukot/superfile/releases/tag/v1.1.7)
58+
59+
> 2024-01-06
60+
61+
NOTE: This release is a hotfix to resolve an unusual issue on Windows.
62+
63+
#### Bug fix
64+
- Fix can't run on windows [`#534`](https://github.com/yorukot/superfile/issues/534)
65+
566
# [**v1.1.7**](https://github.com/yorukot/superfile/releases/tag/v1.1.7)
667

768
> 2024-01-05

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
packages = rec {
2828
superfile = pkgs.buildGoApplication {
2929
pname = "superfile";
30-
version = "1.1.7.1";
30+
version = "1.2.0.0";
3131
src = ./.;
3232
modules = ./gomod2nix.toml;
3333
};

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ require (
1616
github.com/reinhrst/fzf-lib v0.9.0
1717
github.com/rkoesters/xdg v0.0.1
1818
github.com/shirou/gopsutil v3.21.11+incompatible
19+
github.com/stretchr/testify v1.9.0
1920
github.com/urfave/cli/v2 v2.27.5
21+
golang.org/x/mod v0.23.0
2022
golift.io/xtractr v0.2.2
2123
)
2224

2325
require (
2426
github.com/charmbracelet/x/ansi v0.8.0 // indirect
2527
github.com/charmbracelet/x/term v0.2.1 // indirect
2628
golang.org/x/image v0.18.0 // indirect
29+
gopkg.in/yaml.v3 v3.0.1 // indirect
2730
)
2831

2932
require (

go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ github.com/kdomanski/iso9660 v0.3.3/go.mod h1:K+UlIGxKgtrdAWyoigPnFbeQLVs/Xudz4i
128128
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
129129
github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY=
130130
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
131+
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
131132
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
132133
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
134+
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
133135
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
134136
github.com/lithammer/shortuuid v3.0.0+incompatible h1:NcD0xWW/MZYXEHa6ITy6kaXN5nwm/V115vj2YXfhS0w=
135137
github.com/lithammer/shortuuid v3.0.0+incompatible/go.mod h1:FR74pbAuElzOUuenUHTK2Tciko1/vKuIKS9dSkDrA4w=
@@ -239,6 +241,8 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
239241
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
240242
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
241243
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
244+
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
245+
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
242246
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
243247
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
244248
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -369,6 +373,7 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
369373
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
370374
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
371375
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
376+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
372377
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
373378
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
374379
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

gomod2nix.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ schema = 3
148148
[mod."github.com/shirou/gopsutil"]
149149
version = "v3.21.11+incompatible"
150150
hash = "sha256-tcH5zN94yZhKtg8wAUfojlqdyguifuPTBLPso3KF7QA="
151+
[mod."github.com/stretchr/testify"]
152+
version = "v1.9.0"
153+
hash = "sha256-uUp/On+1nK+lARkTVtb5RxlW15zxtw2kaAFuIASA+J0="
151154
[mod."github.com/ulikunitz/xz"]
152155
version = "v0.5.11"
153156
hash = "sha256-SUyrjc2wyN3cTGKe5JdBEXjtZC1rJySRxJHVUZ59row="
@@ -169,6 +172,9 @@ schema = 3
169172
[mod."golang.org/x/image"]
170173
version = "v0.18.0"
171174
hash = "sha256-g9N/y4asXG1lctPJ1KEf8XIjeJi/mQ43EXUa8HTj/zQ="
175+
[mod."golang.org/x/mod"]
176+
version = "v0.23.0"
177+
hash = "sha256-8mlTcEyJy1ETxCO4g7RjZ4Z5nJvXRNwKLwAOoe2GChI="
172178
[mod."golang.org/x/sync"]
173179
version = "v0.11.0"
174180
hash = "sha256-5ZBfDJvNaUBM4Vhk0fgYblCGL3eBxiJL85nIE8LiKl0="
@@ -181,3 +187,6 @@ schema = 3
181187
[mod."golift.io/xtractr"]
182188
version = "v0.2.2"
183189
hash = "sha256-ihKdIrWG1DKADjQ4X1AW62EGZWGgYU+9dY3g260bNOY="
190+
[mod."gopkg.in/yaml.v3"]
191+
version = "v3.0.1"
192+
hash = "sha256-FqL9TKYJ0XkNwJFnq9j0VvJ5ZUU1RvH/52h/f5bkYAU="

release/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env -S bash -euo pipefail
22

33
projectName="superfile"
4-
version="v1.1.7.1"
4+
version="v1.2.0.0"
55
osList=("darwin" "linux" "windows")
66
archList=("amd64" "arm64")
77
mkdir dist

src/cmd/main.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"net/http"
1111
"os"
1212
"runtime"
13-
"strconv"
14-
"strings"
1513
"time"
1614

1715
tea "github.com/charmbracelet/bubbletea"
@@ -324,8 +322,13 @@ func CheckForUpdates() {
324322
return
325323
}
326324

327-
//Check if the local version is outdated
328-
if versionToNumber(release.TagName) > versionToNumber(variable.CurrentVersion) {
325+
// Check if the local version is outdated
326+
res, err := versionCompare(release.TagName, variable.CurrentVersion)
327+
if err != nil {
328+
slog.Error("Error while trying to compare versions", "error", err)
329+
return
330+
}
331+
if res > 0 {
329332
fmt.Println(lipgloss.NewStyle().Foreground(lipgloss.Color("#FF69E1")).Render("┃ ") +
330333
lipgloss.NewStyle().Foreground(lipgloss.Color("#FFBA52")).Bold(true).Render("A new version ") +
331334
lipgloss.NewStyle().Foreground(lipgloss.Color("#00FFF2")).Bold(true).Italic(true).Render(release.TagName) +
@@ -336,12 +339,3 @@ func CheckForUpdates() {
336339
}
337340
}
338341
}
339-
340-
// Convert version string to number
341-
func versionToNumber(version string) int {
342-
version = strings.ReplaceAll(version, "v", "")
343-
version = strings.ReplaceAll(version, ".", "")
344-
345-
num, _ := strconv.Atoi(version)
346-
return num
347-
}

src/cmd/main_utils.go

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
"strconv"
6+
"strings"
7+
)
8+
9+
// Assuming both a and b are string in format of
10+
// vX.Y.Z.W .... (any number of digits allowed)
11+
// Return 1 if a > b
12+
// Return 0 if a == b
13+
// Return -1 if a < b
14+
// Return non-nil error if string are not correctly formated
15+
func versionCompare(a string, b string) (int, error) {
16+
res := 0
17+
if len(a) < 2 || len(b) < 2 || a[0] != 'v' || b[0] != 'v' {
18+
return res, fmt.Errorf("Invalid version strings %v and %v", a, b)
19+
}
20+
21+
a_parts := strings.Split(strings.TrimPrefix(a, "v"), ".")
22+
b_parts := strings.Split(strings.TrimPrefix(b, "v"), ".")
23+
curIdx := 0
24+
for curIdx < len(a_parts) && curIdx < len(b_parts) {
25+
aVal, bVal := 0, 0
26+
aVal, err := strconv.Atoi(a_parts[curIdx])
27+
if err != nil || aVal < 0 {
28+
return res, fmt.Errorf("Non positive integer %v in version : %w", a_parts[curIdx], err)
29+
}
30+
bVal, err = strconv.Atoi(b_parts[curIdx])
31+
if err != nil || bVal < 0 {
32+
return res, fmt.Errorf("Non positive integer %v in version : %w", b_parts[curIdx], err)
33+
}
34+
if aVal > bVal {
35+
return 1, nil
36+
} else if aVal < bVal {
37+
return -1, nil
38+
}
39+
// Otherwise continue iteration
40+
curIdx++
41+
}
42+
43+
if curIdx < len(a_parts) {
44+
// some parts of a are still left, while b is completely iterated
45+
// Just make sure they are all integers
46+
for curIdx < len(a_parts) {
47+
if aVal, err := strconv.Atoi(a_parts[curIdx]); err != nil || aVal < 0 {
48+
return res, fmt.Errorf("Non integer part %v in version : %w", a_parts[curIdx], err)
49+
}
50+
curIdx++
51+
}
52+
return 1, nil
53+
}
54+
55+
if curIdx < len(b_parts) {
56+
// some parts of b are still left, while a is completely iterated
57+
// Just make sure they are all integers
58+
for curIdx < len(b_parts) {
59+
if bVal, err := strconv.Atoi(b_parts[curIdx]); err != nil || bVal < 0 {
60+
return res, fmt.Errorf("Non integer part %v in version : %w", b_parts[curIdx], err)
61+
}
62+
curIdx++
63+
}
64+
return -1, nil
65+
}
66+
67+
// Both a and b are completely iterated
68+
return 0, nil
69+
70+
}

src/cmd/main_utils_test.go

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package cmd
2+
3+
import (
4+
"github.com/stretchr/testify/assert"
5+
"testing"
6+
)
7+
8+
func Test_versionCompare(t *testing.T) {
9+
data := []struct {
10+
vA string
11+
vB string
12+
expectedError bool
13+
expectedResult int
14+
description string
15+
}{
16+
{"v1.2.0", "v1.3.0", false, -1, "Basic version comparison (a < b)"},
17+
{"v1.2.0", "v1.1.7.1", false, 1, "Version with more parts is greater"},
18+
{"v1.2.0", "v3", false, -1, "Single digit version comparison"},
19+
{"v1.7.1", "v1.7.1", false, 0, "Exact version match"},
20+
{"v4", "v4", false, 0, "Single digit version match"},
21+
{"v4", "v5", false, -1, "Single digit version comparison"},
22+
{"v5", "v4", false, 1, "Single digit version comparison (reverse)"},
23+
{"v5.1", "v5", false, 1, "Version with additional part is greater"},
24+
{"v5", "v5.1", false, -1, "Shorter version is lesser"},
25+
26+
// Error cases
27+
{"1.7.1", "v1.7.1", true, 0, "Missing 'v' prefix (first version)"},
28+
{"v1.7a.1", "v1.7.1", true, 0, "Non-numeric part in version"},
29+
{"v1.7.1.", "v1.7.1", true, 0, "Trailing dot in version"},
30+
{"v1.7.1", "v1.7.1.", true, 0, "Trailing dot in second version"},
31+
{"v", "v1", true, 0, "Incomplete version string"},
32+
{"v1.-1.0", "v1.0.0", true, 0, "Negative number in version"},
33+
{"v1.2..3", "v1.2.3", true, 0, "Double dot in version"},
34+
35+
{"v1.0.0", "v1.0.1", false, -1, "Smallest difference in last part"},
36+
{"v10.0.0", "v2.0.0", false, 1, "Multi-digit version comparison"},
37+
{"v1.2.3.4.5", "v1.2.3.4.6", false, -1, "Many version parts comparison"},
38+
{"v1.2.3.4.5", "v1.2.3.4.5", false, 0, "Many version parts exact match"},
39+
{"v0.1.0", "v1.0.0", false, -1, "Zero to non-zero version comparison"},
40+
{"v0", "v0.0.1", false, -1, "Zero version with additional parts"},
41+
{"v0.0.0", "v0", false, 1, "Multiple zero representations"},
42+
{"v01.2.3", "v1.2.3", false, 0, "Leading zero in version part"},
43+
{"v1.2.03", "v1.2.3", false, 0, "Leading zero in version part"},
44+
}
45+
46+
for _, tt := range data {
47+
t.Run(tt.description, func(t *testing.T) {
48+
res, err := versionCompare(tt.vA, tt.vB)
49+
if tt.expectedError {
50+
assert.NotNil(t, err, "Error is expected for %s", tt.description)
51+
} else {
52+
assert.Nil(t, err, "Error should be Nil for %s", tt.description)
53+
assert.Equal(t, tt.expectedResult, res, "Result should be as expected for %s", tt.description)
54+
}
55+
})
56+
}
57+
}

src/config/fixed_variable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
const (
10-
CurrentVersion string = "v1.1.7.1"
10+
CurrentVersion string = "v1.2.0.0"
1111
LatestVersionURL string = "https://api.github.com/repos/yorukot/superfile/releases/latest"
1212
LatestVersionGithub string = "github.com/yorukot/superfile/releases/latest"
1313

website/public/install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Write-Host -ForegroundColor Red " `$`$/
2222
Write-Host ""
2323

2424
$package = "superfile"
25-
$version = "1.1.7.1"
25+
$version = "1.2.0.0"
2626

2727
$installInstructions = @'
2828
This installer is only available for Windows.

website/public/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if [ $? -ne 0 ]; then
3939
fi
4040

4141
package=superfile
42-
version=1.1.7.1
42+
version=1.2.0.0
4343
arch=$(uname -m)
4444
os=$(uname -s)
4545

website/public/uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Write-Host -ForegroundColor Red " `$`$/
2222
Write-Host ""
2323

2424
$package = "superfile"
25-
$version = "1.1.7.1"
25+
$version = "1.2.0.0"
2626

2727
$installInstructions = @'
2828
This uninstaller is only available for Windows.

0 commit comments

Comments
 (0)