mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix(linux): remove support for upgrade
resolves #4992 as we are not able to support the upgrade command on linux as updating oh-my-posh from within itself is impossible to due a lock on the executable, unlike on darwin Windows is able to update the executable after we start the installer in the background and exit the current process
This commit is contained in:
parent
92927638bf
commit
fdf0de08c4
|
@ -2,6 +2,7 @@ package cli
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/upgrade"
|
||||
|
@ -17,6 +18,11 @@ var upgradeCmd = &cobra.Command{
|
|||
Long: "Upgrade when a new version is available.",
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
if runtime.GOOS == platform.LINUX {
|
||||
fmt.Print("\n ⚠️ upgrade is not supported on this platform\n\n")
|
||||
return
|
||||
}
|
||||
|
||||
if force {
|
||||
upgrade.Run()
|
||||
return
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//go:build windows || darwin
|
||||
|
||||
package upgrade
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
//go:build !windows
|
||||
|
||||
package upgrade
|
||||
|
||||
import (
|
5
src/upgrade/cli_other.go
Normal file
5
src/upgrade/cli_other.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
//go:build linux || freebsd || openbsd
|
||||
|
||||
package upgrade
|
||||
|
||||
func Run() {}
|
Loading…
Reference in a new issue