Describe the bug
When running the matcha update command as a standard user, the update fails because it attempts to create the temporary binary file directly in the installation directory (/usr/local/bin/), which requires root privileges.
To reproduce
Steps to Reproduce:
- Have matcha installed in a directory that requires root privileges (e.g., /usr/local/bin).
- Run the update command as a standard user: matcha
- The download starts but fails at the file creation step.
Actual Behavior
The updater tries to write the temp file directly to the target directory and throws a permission error:
Plaintext
> matcha update
Current version: 0.36.1
Latest version: 0.37.0
Found release asset: matcha_0.37.0_linux_amd64.tar.gz
Downloading...
update failed: could not create temp binary in target dir: open /usr/local/bin/matcha.new.1778155730: permission denied
Expected behavior
Expected Behavior / Proposed Solution
Instead of attempting to write directly to the protected target directory, it would be more logical for the updater to:
Download the temporary file to `/tmp/`.
Then, either prompt the user for `sudo` privileges to move the binary into `/usr/local/bin/`, or exit gracefully with a clear message instructing the user to run the update command with `sudo` (e.g., Please run 'sudo matcha update`').
Environment
OS: Fedora 43
Matcha Version: 0.36.1 (updating to 0.37.0)
Screenshots
Matcha version
0.36.1
Go version
1.25.9
OS
Linux
OS version
Fedora 43
Architecture
amd64 (x86_64)
Terminal
Kitty
Additional context

Describe the bug
When running the matcha update command as a standard user, the update fails because it attempts to create the temporary binary file directly in the installation directory (/usr/local/bin/), which requires root privileges.
To reproduce
Steps to Reproduce:
Actual Behavior
The updater tries to write the temp file directly to the target directory and throws a permission error:
Plaintext
Expected behavior
Expected Behavior / Proposed Solution
Instead of attempting to write directly to the protected target directory, it would be more logical for the updater to:
Environment
Screenshots
Matcha version
0.36.1
Go version
1.25.9
OS
Linux
OS version
Fedora 43
Architecture
amd64 (x86_64)
Terminal
Kitty
Additional context