Skip to content

Commit

Permalink
Merge pull request #672 from yorukot/1.2.0.0-release
Browse files Browse the repository at this point in the history
chore(release): 1.2.0.0 release
  • Loading branch information
yorukot authored Mar 5, 2025
2 parents 34fd3e6 + 3a7375f commit 8113c7e
Show file tree
Hide file tree
Showing 14 changed files with 270 additions and 19 deletions.
61 changes: 61 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,67 @@

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

# [**v1.2.0.0**](https://github.com/yorukot/superfile/releases/tag/v1.2.0.0)

> 2025-03-05
#### Update
- Added direnv support for nix flake dev shell [`#568`](https://github.com/yorukot/superfile/pull/568)
- Move rename cursor to start before the extension [`#565`](https://github.com/yorukot/superfile/pull/565)
- Renaming feature for pinned directories [`#579`](https://github.com/yorukot/superfile/pull/579)
- Add python testsuite [`#581`](https://github.com/yorukot/superfile/pull/581)
- Add build instructions for windows [`#583`](https://github.com/yorukot/superfile/pull/583)
- Add `--config-file` flag support [`#592`](https://github.com/yorukot/superfile/pull/592)
- Document Windows scoop installation option [`#595`](https://github.com/yorukot/superfile/pull/595)
- Rotate image using EXIF metadata [`#607`](https://github.com/yorukot/superfile/pull/607)
- Upgrade sidebar search [`#614`](https://github.com/yorukot/superfile/pull/614)
- Change all outPutLog to slog.Error or slog.Info [`#628`](https://github.com/yorukot/superfile/pull/628)
- Add install.sh files link for more trust [`#645`](https://github.com/yorukot/superfile/pull/645)
- Update README.md and added a Run the app title [`#550`](https://github.com/yorukot/superfile/pull/550)

#### Bug fix
- Fix sort options hotkey [`#548`](https://github.com/yorukot/superfile/pull/548)
- Fix wrong log line, Fatalln was used with formatting verbs [`#555`](https://github.com/yorukot/superfile/pull/555)
- Fix incorrect failure reporting in delete operation [`#558`](https://github.com/yorukot/superfile/pull/558)
- Fix previews for text file with control characters [`#557`](https://github.com/yorukot/superfile/pull/557)
- Fix search field key blocking [`#569`](https://github.com/yorukot/superfile/pull/569)
- Fix windows operations and other improvements [`#564`](https://github.com/yorukot/superfile/pull/564)
- Fix crash when searching on WSL mounted drives [`#576`](https://github.com/yorukot/superfile/pull/576)
- Fix arch install instructions [`#580`](https://github.com/yorukot/superfile/pull/580)
- Fix windows delete, open file and other improvements [`#584`](https://github.com/yorukot/superfile/pull/584)
- Fix UI issue of spf stuck with terminal size too small [`#594`](https://github.com/yorukot/superfile/pull/594)
- Fix wrong path separator in windows [`#597`](https://github.com/yorukot/superfile/pull/597)
- Fix command line not working for windows [`#601`](https://github.com/yorukot/superfile/pull/601)
- Fix error while reading last check version file in new time zone [`#634`](https://github.com/yorukot/superfile/pull/634)
- Fix discrete timeout for HTTP get version [`#632`](https://github.com/yorukot/superfile/pull/632)
- Fix initial pinned.json having invalid JSON [`#652`](https://github.com/yorukot/superfile/pull/652)
- Fix loadConfigFile and loadHotkeysFile functions [`#650`](https://github.com/yorukot/superfile/pull/650)
- Fix issue when trying to extract a file with .zip_ extension [`#636`](https://github.com/yorukot/superfile/pull/636)
- Fix openFileWithEditor bug [`#635`](https://github.com/yorukot/superfile/pull/635)
- Fix partial overwrite issue by ensuring full file rewrite [`#665`](https://github.com/yorukot/superfile/pull/665)

#### Optimization
- Improving file panel rendering [`#589`](https://github.com/yorukot/superfile/pull/589)
- Improve formatting, error handling, and fix typos [`#600`](https://github.com/yorukot/superfile/pull/600)
- Go formatting fixes [`#618`](https://github.com/yorukot/superfile/pull/618)
- Testsuite in GitHub Actions [`#602`](https://github.com/yorukot/superfile/pull/602)

#### Documentation
- Revert changes in website that were not yet released [`#611`](https://github.com/yorukot/superfile/pull/611)
- Docs contribute [`#610`](https://github.com/yorukot/superfile/pull/610)
- Remove godocs badge [`#627`](https://github.com/yorukot/superfile/pull/627)
- Update installation.md to note setting nerd-font in terminal application [`#658`](https://github.com/yorukot/superfile/pull/658)
- Fix README typos [`#653`](https://github.com/yorukot/superfile/pull/653)

# [**v1.1.7.1**](https://github.com/yorukot/superfile/releases/tag/v1.1.7)

> 2024-01-06
NOTE: This release is a hotfix to resolve an unusual issue on Windows.

#### Bug fix
- Fix can't run on windows [`#534`](https://github.com/yorukot/superfile/issues/534)

# [**v1.1.7**](https://github.com/yorukot/superfile/releases/tag/v1.1.7)

> 2024-01-05
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
packages = rec {
superfile = pkgs.buildGoApplication {
pname = "superfile";
version = "1.1.7.1";
version = "1.2.0.0";
src = ./.;
modules = ./gomod2nix.toml;
};
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ require (
github.com/reinhrst/fzf-lib v0.9.0
github.com/rkoesters/xdg v0.0.1
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.5
golang.org/x/mod v0.23.0
golift.io/xtractr v0.2.2
)

require (
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
golang.org/x/image v0.18.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ github.com/kdomanski/iso9660 v0.3.3/go.mod h1:K+UlIGxKgtrdAWyoigPnFbeQLVs/Xudz4i
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY=
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lithammer/shortuuid v3.0.0+incompatible h1:NcD0xWW/MZYXEHa6ITy6kaXN5nwm/V115vj2YXfhS0w=
github.com/lithammer/shortuuid v3.0.0+incompatible/go.mod h1:FR74pbAuElzOUuenUHTK2Tciko1/vKuIKS9dSkDrA4w=
Expand Down Expand Up @@ -239,6 +241,8 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -369,6 +373,7 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
9 changes: 9 additions & 0 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ schema = 3
[mod."github.com/shirou/gopsutil"]
version = "v3.21.11+incompatible"
hash = "sha256-tcH5zN94yZhKtg8wAUfojlqdyguifuPTBLPso3KF7QA="
[mod."github.com/stretchr/testify"]
version = "v1.9.0"
hash = "sha256-uUp/On+1nK+lARkTVtb5RxlW15zxtw2kaAFuIASA+J0="
[mod."github.com/ulikunitz/xz"]
version = "v0.5.11"
hash = "sha256-SUyrjc2wyN3cTGKe5JdBEXjtZC1rJySRxJHVUZ59row="
Expand All @@ -169,6 +172,9 @@ schema = 3
[mod."golang.org/x/image"]
version = "v0.18.0"
hash = "sha256-g9N/y4asXG1lctPJ1KEf8XIjeJi/mQ43EXUa8HTj/zQ="
[mod."golang.org/x/mod"]
version = "v0.23.0"
hash = "sha256-8mlTcEyJy1ETxCO4g7RjZ4Z5nJvXRNwKLwAOoe2GChI="
[mod."golang.org/x/sync"]
version = "v0.11.0"
hash = "sha256-5ZBfDJvNaUBM4Vhk0fgYblCGL3eBxiJL85nIE8LiKl0="
Expand All @@ -181,3 +187,6 @@ schema = 3
[mod."golift.io/xtractr"]
version = "v0.2.2"
hash = "sha256-ihKdIrWG1DKADjQ4X1AW62EGZWGgYU+9dY3g260bNOY="
[mod."gopkg.in/yaml.v3"]
version = "v3.0.1"
hash = "sha256-FqL9TKYJ0XkNwJFnq9j0VvJ5ZUU1RvH/52h/f5bkYAU="
2 changes: 1 addition & 1 deletion release/release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S bash -euo pipefail

projectName="superfile"
version="v1.1.7.1"
version="v1.2.0.0"
osList=("darwin" "linux" "windows")
archList=("amd64" "arm64")
mkdir dist
Expand Down
20 changes: 7 additions & 13 deletions src/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"net/http"
"os"
"runtime"
"strconv"
"strings"
"time"

tea "github.com/charmbracelet/bubbletea"
Expand Down Expand Up @@ -324,8 +322,13 @@ func CheckForUpdates() {
return
}

//Check if the local version is outdated
if versionToNumber(release.TagName) > versionToNumber(variable.CurrentVersion) {
// Check if the local version is outdated
res, err := versionCompare(release.TagName, variable.CurrentVersion)
if err != nil {
slog.Error("Error while trying to compare versions", "error", err)
return
}
if res > 0 {
fmt.Println(lipgloss.NewStyle().Foreground(lipgloss.Color("#FF69E1")).Render("┃ ") +
lipgloss.NewStyle().Foreground(lipgloss.Color("#FFBA52")).Bold(true).Render("A new version ") +
lipgloss.NewStyle().Foreground(lipgloss.Color("#00FFF2")).Bold(true).Italic(true).Render(release.TagName) +
Expand All @@ -336,12 +339,3 @@ func CheckForUpdates() {
}
}
}

// Convert version string to number
func versionToNumber(version string) int {
version = strings.ReplaceAll(version, "v", "")
version = strings.ReplaceAll(version, ".", "")

num, _ := strconv.Atoi(version)
return num
}
70 changes: 70 additions & 0 deletions src/cmd/main_utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package cmd

import (
"fmt"
"strconv"
"strings"
)

// Assuming both a and b are string in format of
// vX.Y.Z.W .... (any number of digits allowed)
// Return 1 if a > b
// Return 0 if a == b
// Return -1 if a < b
// Return non-nil error if string are not correctly formated
func versionCompare(a string, b string) (int, error) {
res := 0
if len(a) < 2 || len(b) < 2 || a[0] != 'v' || b[0] != 'v' {
return res, fmt.Errorf("Invalid version strings %v and %v", a, b)
}

a_parts := strings.Split(strings.TrimPrefix(a, "v"), ".")
b_parts := strings.Split(strings.TrimPrefix(b, "v"), ".")
curIdx := 0
for curIdx < len(a_parts) && curIdx < len(b_parts) {
aVal, bVal := 0, 0
aVal, err := strconv.Atoi(a_parts[curIdx])
if err != nil || aVal < 0 {
return res, fmt.Errorf("Non positive integer %v in version : %w", a_parts[curIdx], err)
}
bVal, err = strconv.Atoi(b_parts[curIdx])
if err != nil || bVal < 0 {
return res, fmt.Errorf("Non positive integer %v in version : %w", b_parts[curIdx], err)
}
if aVal > bVal {
return 1, nil
} else if aVal < bVal {
return -1, nil
}
// Otherwise continue iteration
curIdx++
}

if curIdx < len(a_parts) {
// some parts of a are still left, while b is completely iterated
// Just make sure they are all integers
for curIdx < len(a_parts) {
if aVal, err := strconv.Atoi(a_parts[curIdx]); err != nil || aVal < 0 {
return res, fmt.Errorf("Non integer part %v in version : %w", a_parts[curIdx], err)
}
curIdx++
}
return 1, nil
}

if curIdx < len(b_parts) {
// some parts of b are still left, while a is completely iterated
// Just make sure they are all integers
for curIdx < len(b_parts) {
if bVal, err := strconv.Atoi(b_parts[curIdx]); err != nil || bVal < 0 {
return res, fmt.Errorf("Non integer part %v in version : %w", b_parts[curIdx], err)
}
curIdx++
}
return -1, nil
}

// Both a and b are completely iterated
return 0, nil

}
57 changes: 57 additions & 0 deletions src/cmd/main_utils_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package cmd

import (
"github.com/stretchr/testify/assert"
"testing"
)

func Test_versionCompare(t *testing.T) {
data := []struct {
vA string
vB string
expectedError bool
expectedResult int
description string
}{
{"v1.2.0", "v1.3.0", false, -1, "Basic version comparison (a < b)"},
{"v1.2.0", "v1.1.7.1", false, 1, "Version with more parts is greater"},
{"v1.2.0", "v3", false, -1, "Single digit version comparison"},
{"v1.7.1", "v1.7.1", false, 0, "Exact version match"},
{"v4", "v4", false, 0, "Single digit version match"},
{"v4", "v5", false, -1, "Single digit version comparison"},
{"v5", "v4", false, 1, "Single digit version comparison (reverse)"},
{"v5.1", "v5", false, 1, "Version with additional part is greater"},
{"v5", "v5.1", false, -1, "Shorter version is lesser"},

// Error cases
{"1.7.1", "v1.7.1", true, 0, "Missing 'v' prefix (first version)"},
{"v1.7a.1", "v1.7.1", true, 0, "Non-numeric part in version"},
{"v1.7.1.", "v1.7.1", true, 0, "Trailing dot in version"},
{"v1.7.1", "v1.7.1.", true, 0, "Trailing dot in second version"},
{"v", "v1", true, 0, "Incomplete version string"},
{"v1.-1.0", "v1.0.0", true, 0, "Negative number in version"},
{"v1.2..3", "v1.2.3", true, 0, "Double dot in version"},

{"v1.0.0", "v1.0.1", false, -1, "Smallest difference in last part"},
{"v10.0.0", "v2.0.0", false, 1, "Multi-digit version comparison"},
{"v1.2.3.4.5", "v1.2.3.4.6", false, -1, "Many version parts comparison"},
{"v1.2.3.4.5", "v1.2.3.4.5", false, 0, "Many version parts exact match"},
{"v0.1.0", "v1.0.0", false, -1, "Zero to non-zero version comparison"},
{"v0", "v0.0.1", false, -1, "Zero version with additional parts"},
{"v0.0.0", "v0", false, 1, "Multiple zero representations"},
{"v01.2.3", "v1.2.3", false, 0, "Leading zero in version part"},
{"v1.2.03", "v1.2.3", false, 0, "Leading zero in version part"},
}

for _, tt := range data {
t.Run(tt.description, func(t *testing.T) {
res, err := versionCompare(tt.vA, tt.vB)
if tt.expectedError {
assert.NotNil(t, err, "Error is expected for %s", tt.description)
} else {
assert.Nil(t, err, "Error should be Nil for %s", tt.description)
assert.Equal(t, tt.expectedResult, res, "Result should be as expected for %s", tt.description)
}
})
}
}
2 changes: 1 addition & 1 deletion src/config/fixed_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const (
CurrentVersion string = "v1.1.7.1"
CurrentVersion string = "v1.2.0.0"
LatestVersionURL string = "https://api.github.com/repos/yorukot/superfile/releases/latest"
LatestVersionGithub string = "github.com/yorukot/superfile/releases/latest"

Expand Down
2 changes: 1 addition & 1 deletion website/public/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Write-Host -ForegroundColor Red " `$`$/
Write-Host ""

$package = "superfile"
$version = "1.1.7.1"
$version = "1.2.0.0"

$installInstructions = @'
This installer is only available for Windows.
Expand Down
2 changes: 1 addition & 1 deletion website/public/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [ $? -ne 0 ]; then
fi

package=superfile
version=1.1.7.1
version=1.2.0.0
arch=$(uname -m)
os=$(uname -s)

Expand Down
2 changes: 1 addition & 1 deletion website/public/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Write-Host -ForegroundColor Red " `$`$/
Write-Host ""

$package = "superfile"
$version = "1.1.7.1"
$version = "1.2.0.0"

$installInstructions = @'
This uninstaller is only available for Windows.
Expand Down
Loading

0 comments on commit 8113c7e

Please sign in to comment.