2.4 KiB
Windows Compatibility Guide
This document outlines Windows compatibility issues and solutions for the envr project.
Critical Issues
1. Path Handling Bug (MUST FIX)
File: app/env_file.go:209
Issue: Uses path.Join instead of filepath.Join, which won't work correctly on Windows due to different path separators.
Current code:
f.Path = path.Join(newDir, path.Base(f.Path))
Fixed code:
f.Path = filepath.Join(newDir, filepath.Base(f.Path))
External Dependencies
The application relies on external tools that need to be installed separately on Windows:
Required Tools
-
fd - Fast file finder
- Install via:
winget install sharkdp.fdorchoco install fd - Alternative:
scoop install fd
- Install via:
-
git - Version control system
- Install via:
winget install Git.Gitor download from git-scm.com - Usually already available on most development machines
- Install via:
Minor Compatibility Notes
File Permissions
- Unix file permissions (
0755,0644) are used throughout the codebase - These are safely ignored on Windows - no changes needed
Editor Configuration
File: cmd/edit_config.go:20-24
Issue: Relies on $EDITOR environment variable which is less common on Windows.
Current behavior: Fails if $EDITOR is not set
Recommended improvement: Add fallback detection for Windows editors:
editor := os.Getenv("EDITOR")
if editor == "" {
if runtime.GOOS == "windows" {
editor = "notepad.exe" // or "code.exe" for VS Code
} else {
fmt.Println("Error: $EDITOR environment variable is not set")
return
}
}
Installation Instructions for Windows
-
Install required dependencies:
winget install sharkdp.fd winget install Git.Git -
Fix the path handling bug in
app/env_file.go:209 -
Build and run as normal:
go build .\envr.exe init
Testing on Windows
After applying the critical path fix, the core functionality should work correctly on Windows. The application has been designed with cross-platform compatibility in mind, using:
filepathpackage for path operations (mostly)os.UserHomeDir()for home directory detection- Standard Go file operations
Summary
- 1 critical bug must be fixed for Windows compatibility
- 2 external tools need to be installed
- 1 minor enhancement recommended for better Windows UX
- Overall architecture is Windows-compatible