rhysd / go-github-selfupdate

Binary self-update mechanism for Go commands using GitHub

Home Page:https://godoc.org/github.com/rhysd/go-github-selfupdate/selfupdate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Root privileges required

FrenchGithubUser opened this issue · comments

commented

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 ?

commented

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.