Fix config lookup ENOTDIR and prepare v0.1.4

This commit is contained in:
vrubelroman 2026-04-24 15:44:07 +03:00
parent 6b23717572
commit 87f43e0c6a
3 changed files with 15 additions and 10 deletions

View file

@ -64,21 +64,21 @@ go build -o vcom ./cmd/vcom
Run directly from the flake: Run directly from the flake:
```bash ```bash
nix run github:vrubelroman/vcom?ref=v0.1.3 nix run github:vrubelroman/vcom?ref=v0.1.4
``` ```
Install into user profile: Install into user profile:
```bash ```bash
nix profile add github:vrubelroman/vcom?ref=v0.1.3 nix profile add github:vrubelroman/vcom?ref=v0.1.4
``` ```
### Debian / Ubuntu ### Debian / Ubuntu
Download the release `.deb` for `v0.1.3`, then install: Download the release `.deb` for `v0.1.4`, then install:
```bash ```bash
sudo apt install ./vcom_0.1.3_amd64.deb sudo apt install ./vcom_0.1.4_amd64.deb
``` ```
Install a Nerd Font (example): Install a Nerd Font (example):
@ -130,7 +130,7 @@ Built-in themes:
## Releases ## 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 - runs tests
- vendors Go modules - vendors Go modules
@ -140,9 +140,9 @@ Pushing a tag like `v0.1.3` triggers GitHub Actions release workflow (`.github/w
Release artifacts: Release artifacts:
- `vcom-v0.1.3-x86_64-unknown-linux-gnu.tar.gz` - `vcom-v0.1.4-x86_64-unknown-linux-gnu.tar.gz`
- `vcom_0.1.3_amd64.deb` - `vcom_0.1.4_amd64.deb`
- `vcom-v0.1.3-checksums.txt` - `vcom-v0.1.4-checksums.txt`
## Notes ## Notes

View file

@ -13,7 +13,7 @@
lib = pkgs.lib; lib = pkgs.lib;
packageBase = pkgs.buildGoModule { packageBase = pkgs.buildGoModule {
pname = "vcom"; pname = "vcom";
version = "0.1.3"; version = "0.1.4";
src = ./.; src = ./.;
vendorHash = null; vendorHash = null;

View file

@ -6,6 +6,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"syscall"
toml "github.com/pelletier/go-toml/v2" 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 { if _, err := os.Stat(absPath); err == nil {
return absPath, true, 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) return "", false, fmt.Errorf("stat %s: %w", absPath, err)
} }
} }
@ -255,6 +256,10 @@ func resolvePath(explicitPath string) (string, bool, error) {
return "", false, nil return "", false, nil
} }
func isMissingPathError(err error) bool {
return errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTDIR)
}
func DefaultUserPath() (string, error) { func DefaultUserPath() (string, error) {
homeDir, err := os.UserHomeDir() homeDir, err := os.UserHomeDir()
if err != nil { if err != nil {