Skip to content

Commit 689f5ed

Browse files
authored
fix: Set default download directory to .cq (#230)
Currently plugins are downloaded to `CWD/plugins/*`. This PR changes it so they are downloaded to `CWD/.cq/plugins/*` ---
1 parent b3a3e3b commit 689f5ed

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

clients/destination.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func WithDestinationGrpcConn(userConn *grpc.ClientConn) func(*DestinationClient)
6262
func NewDestinationClient(ctx context.Context, registry specs.Registry, path string, version string, opts ...DestinationClientOption) (*DestinationClient, error) {
6363
var err error
6464
c := &DestinationClient{
65-
directory: "./",
65+
directory: DefaultDownloadDir,
6666
}
6767
for _, opt := range opts {
6868
opt(c)

clients/download.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type PluginType string
1616
const (
1717
PluginTypeSource PluginType = "source"
1818
PluginTypeDestination PluginType = "destination"
19+
DefaultDownloadDir = ".cq"
1920
)
2021

2122
func DownloadPluginFromGithub(ctx context.Context, localPath string, org string, name string, version string, typ PluginType, writers ...io.Writer) error {

clients/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func WithSourceWriters(writers ...io.Writer) func(*SourceClient) {
6868
func NewSourceClient(ctx context.Context, registry specs.Registry, path string, version string, opts ...SourceClientOption) (*SourceClient, error) {
6969
var err error
7070
c := &SourceClient{
71-
directory: "./",
71+
directory: DefaultDownloadDir,
7272
}
7373
for _, opt := range opts {
7474
opt(c)

0 commit comments

Comments
 (0)