Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

fix automatic CLI upgrade isn't working in some cases #97

kalil03218fc4584badcd
diff --git a/app/cli/upgrade.go b/app/cli/upgrade.go
index fcc35c71..4ff1546b 100644
--- a/app/cli/upgrade.go
+++ b/app/cli/upgrade.go
@@ -135,6 +135,9 @@ func doUpgrade(version string) error {
if header.Typeflag == tar.TypeReg && (header.Name == "plandex" || header.Name == "plandex.exe") {
err = update.Apply(tarReader, update.Options{})
if err != nil {
+ if os.IsPermission(err) {
+ return fmt.Errorf("failed to apply update due to permission error, please try running again with 'sudo': %w", err)
+ }
return fmt.Errorf("failed to apply update: %w", err)
}
break