Skip to content

Commit

Permalink
Close reader
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Jan 29, 2024
1 parent cf990c2 commit dd13e7a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion cmd/plugin_list.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cmd

import (
"path/filepath"

"github.com/gatewayd-io/gatewayd/config"
"github.com/getsentry/sentry-go"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -32,7 +34,13 @@ var pluginListCmd = &cobra.Command{
defer sentry.Recover()
}

listPlugins(cmd, pluginConfigFile, onlyEnabled)
path, err := filepath.Abs(pluginConfigFile)
if err != nil {
cmd.Println("Error getting absolute path of plugin config file: ", err)
return
}

listPlugins(cmd, path, onlyEnabled)
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func Test_runCmdWithTLS(t *testing.T) {
// Test_runCmdWithMultiTenancy tests the run command with multi-tenancy enabled.
// Note: This test needs two instances of PostgreSQL running on ports 5432 and 5433.
func Test_runCmdWithMultiTenancy(t *testing.T) {
globalTestConfigFile := "testdata/gatewayd.yaml"
globalTestConfigFile := "./testdata/gatewayd.yaml"
pluginTestConfigFile := "./test_plugins_runCmdWithMultiTenancy.yaml"
// Create a test plugins config file.
_, err := executeCommandC(rootCmd, "plugin", "init", "--force", "-p", pluginTestConfigFile)
Expand Down
1 change: 1 addition & 0 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ func extractTarGz(filename, dest string) ([]string, error) {
if err != nil {
return nil, gerr.ErrExtractFailed.Wrap(err)
}
defer uncompressedStream.Close()

// Create the output directory if it doesn't exist.
if err := os.MkdirAll(dest, FolderPermissions); err != nil {
Expand Down

0 comments on commit dd13e7a

Please sign in to comment.