generated from LinuxSuRen/github-go
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support to install packages via scoop (#368)
Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
- Loading branch information
1 parent
885acae
commit eb7be78
Showing
14 changed files
with
191 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package scoop | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/linuxsuren/http-downloader/pkg/exec" | ||
) | ||
|
||
// Tool is the tool name of this intergration | ||
const Tool = "scoop" | ||
|
||
// CommonInstaller is the installer of Conntrack in CentOS | ||
type CommonInstaller struct { | ||
Name string | ||
Execer exec.Execer | ||
} | ||
|
||
// Available check if support current platform | ||
func (d *CommonInstaller) Available() (ok bool) { | ||
if d.Execer.OS() == exec.OSWindows { | ||
_, err := d.Execer.LookPath(Tool) | ||
ok = err == nil | ||
} | ||
return | ||
} | ||
|
||
// Install installs the Conntrack | ||
func (d *CommonInstaller) Install() (err error) { | ||
if err = d.Execer.RunCommand(Tool, "bucket", "add", "extras"); err == nil { | ||
err = d.Execer.RunCommand(Tool, "install", d.Name) | ||
} | ||
return | ||
} | ||
|
||
// Uninstall uninstalls the Conntrack | ||
func (d *CommonInstaller) Uninstall() (err error) { | ||
err = d.Execer.RunCommand(Tool, "uninstall", d.Name) | ||
return | ||
} | ||
|
||
// WaitForStart waits for the service be started | ||
func (d *CommonInstaller) WaitForStart() (ok bool, err error) { | ||
ok = true | ||
return | ||
} | ||
|
||
// Start starts the Conntrack service | ||
func (d *CommonInstaller) Start() error { | ||
fmt.Println("not supported yet") | ||
return nil | ||
} | ||
|
||
// Stop stops the Conntrack service | ||
func (d *CommonInstaller) Stop() error { | ||
fmt.Println("not supported yet") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package scoop implements the scoop integration | ||
package scoop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.