From 87f43e0c6a4c9c796c8c31057a9520ed0c227a78 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Fri, 24 Apr 2026 15:44:07 +0300 Subject: [PATCH] Fix config lookup ENOTDIR and prepare v0.1.4 --- README.md | 16 ++++++++-------- flake.nix | 2 +- internal/config/config.go | 7 ++++++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fc4ad18..40e2c01 100644 --- a/README.md +++ b/README.md @@ -64,21 +64,21 @@ go build -o vcom ./cmd/vcom Run directly from the flake: ```bash -nix run github:vrubelroman/vcom?ref=v0.1.3 +nix run github:vrubelroman/vcom?ref=v0.1.4 ``` Install into user profile: ```bash -nix profile add github:vrubelroman/vcom?ref=v0.1.3 +nix profile add github:vrubelroman/vcom?ref=v0.1.4 ``` ### Debian / Ubuntu -Download the release `.deb` for `v0.1.3`, then install: +Download the release `.deb` for `v0.1.4`, then install: ```bash -sudo apt install ./vcom_0.1.3_amd64.deb +sudo apt install ./vcom_0.1.4_amd64.deb ``` Install a Nerd Font (example): @@ -130,7 +130,7 @@ Built-in themes: ## Releases -Pushing a tag like `v0.1.3` triggers GitHub Actions release workflow (`.github/workflows/release.yml`) which: +Pushing a tag like `v0.1.4` triggers GitHub Actions release workflow (`.github/workflows/release.yml`) which: - runs tests - vendors Go modules @@ -140,9 +140,9 @@ Pushing a tag like `v0.1.3` triggers GitHub Actions release workflow (`.github/w Release artifacts: -- `vcom-v0.1.3-x86_64-unknown-linux-gnu.tar.gz` -- `vcom_0.1.3_amd64.deb` -- `vcom-v0.1.3-checksums.txt` +- `vcom-v0.1.4-x86_64-unknown-linux-gnu.tar.gz` +- `vcom_0.1.4_amd64.deb` +- `vcom-v0.1.4-checksums.txt` ## Notes diff --git a/flake.nix b/flake.nix index ba292c2..512477e 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ lib = pkgs.lib; packageBase = pkgs.buildGoModule { pname = "vcom"; - version = "0.1.3"; + version = "0.1.4"; src = ./.; vendorHash = null; diff --git a/internal/config/config.go b/internal/config/config.go index 22a600f..ef2bf01 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "strings" + "syscall" toml "github.com/pelletier/go-toml/v2" ) @@ -247,7 +248,7 @@ func resolvePath(explicitPath string) (string, bool, error) { } if _, err := os.Stat(absPath); err == nil { return absPath, true, nil - } else if !errors.Is(err, os.ErrNotExist) { + } else if !isMissingPathError(err) { return "", false, fmt.Errorf("stat %s: %w", absPath, err) } } @@ -255,6 +256,10 @@ func resolvePath(explicitPath string) (string, bool, error) { return "", false, nil } +func isMissingPathError(err error) bool { + return errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTDIR) +} + func DefaultUserPath() (string, error) { homeDir, err := os.UserHomeDir() if err != nil {