diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..1b39136 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,13 @@ +# Claude Code Instructions for dtvem + +## Deployment + +After building, always deploy both executables to the user's installation directory: + +```bash +cp dist/dtvem.exe ~/.dtvem/bin/dtvem.exe +cp dist/shim.exe ~/.dtvem/bin/dtvem-shim.exe +~/.dtvem/bin/dtvem.exe reshim +``` + +The `reshim` command must be run after deploying the shim to regenerate all runtime shims (npm, node, python, etc.) with the updated binary. diff --git a/src/cmd/shim/main.go b/src/cmd/shim/main.go index c84567e..6bf10f2 100644 --- a/src/cmd/shim/main.go +++ b/src/cmd/shim/main.go @@ -311,7 +311,17 @@ func executeCommand(execPath string, args []string) error { Stdout: os.Stdout, Stderr: os.Stderr, } - return cmd.Run() + if err := cmd.Run(); err != nil { + // Check if this is an exit error (command ran but returned non-zero) + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + // Command executed successfully but returned non-zero exit code + // This is not a shim error - propagate the exit code + os.Exit(exitErr.ExitCode()) + } + // Other errors (couldn't start, etc.) are actual failures + return err + } } return nil