From 47615c33251b834a9ee1b2a830f109facefd6f47 Mon Sep 17 00:00:00 2001 From: Vilsol Date: Thu, 23 Jun 2022 01:37:36 +0300 Subject: [PATCH] fix: explicitly check schemas --- cli/disk/main.go | 2 -- cli/installations.go | 7 +------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cli/disk/main.go b/cli/disk/main.go index 42b2ec1..c438352 100644 --- a/cli/disk/main.go +++ b/cli/disk/main.go @@ -31,8 +31,6 @@ func FromPath(path string) (Disk, error) { return nil, errors.Wrap(err, "failed to parse path") } - log.Info().Msg(path) - log.Info().Msg(parsed.Scheme) switch parsed.Scheme { case "ftp": log.Info().Str("path", path).Msg("connecting to ftp") diff --git a/cli/installations.go b/cli/installations.go index 25c80d4..0e7c58a 100644 --- a/cli/installations.go +++ b/cli/installations.go @@ -116,7 +116,7 @@ func (i *Installations) AddInstallation(ctx *GlobalContext, installPath string, } var absolutePath = installPath - if parsed.Scheme == "" { + if parsed.Scheme != "ftp" && parsed.Scheme != "sftp" { absolutePath, err = filepath.Abs(installPath) if err != nil { @@ -129,11 +129,6 @@ func (i *Installations) AddInstallation(ctx *GlobalContext, installPath string, Profile: profile, } - // ftp://one:1234@localhost:21/ - - log.Info().Msg("installPath: " + installPath) - log.Info().Msg("absolutePath: " + absolutePath) - if err := installation.Validate(ctx); err != nil { return nil, errors.Wrap(err, "failed to validate installation") }