go-github-selfupdate icon indicating copy to clipboard operation
go-github-selfupdate copied to clipboard

Root privileges required

Open FrenchGithubUser opened this issue 2 years ago • 1 comments

This package works pretty well, thanks for developing it !

But whenthe binary is in a folder that requires admin/root rights to write in like /usr/bin/ or in windows' programs folder, the update fails. Here is the error I get on linux : Error occurred while updating binary: open /usr/bin/.hatt.new: permission denied (the name of my program is hatt)

I was wondering how this issue should be addressed (ask the user for admin rights ? if so, how ? something else ?

FrenchGithubUser avatar Apr 03 '23 16:04 FrenchGithubUser

You could invoke the program with sudo to grant it the required privileges. For example, if you have a update subcommand to invoke the self updating behavior, you could run sudo hatt update.

servusdei2018 avatar Sep 05 '23 13:09 servusdei2018