-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Make plugin test OS independant (#459)
- Loading branch information
Showing
3 changed files
with
13 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,10 @@ package cmd | |
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"runtime" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
@@ -24,7 +26,14 @@ func executeCommandC(root *cobra.Command, args ...string) (string, error) { | |
// mustPullPlugin pulls the gatewayd-plugin-cache plugin and returns the path to the archive. | ||
func mustPullPlugin() (string, error) { | ||
pluginURL := "github.com/gatewayd-io/[email protected]" | ||
fileName := "./gatewayd-plugin-cache-linux-amd64-v0.2.10.tar.gz" | ||
|
||
fileName := fmt.Sprintf( | ||
"./gatewayd-plugin-cache-%s-%s-%s%s", | ||
runtime.GOOS, | ||
runtime.GOARCH, | ||
"v0.2.10", | ||
getFileExtension(), | ||
) | ||
|
||
if _, err := os.Stat(fileName); os.IsNotExist(err) { | ||
_, err := executeCommandC(rootCmd, "plugin", "install", "--pull-only", pluginURL) | ||
|
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