fix: explicitly check schemas

This commit is contained in:
Vilsol 2022-06-23 01:37:36 +03:00
parent ef7f8cc8e8
commit 47615c3325
2 changed files with 1 additions and 8 deletions

View file

@ -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")

View file

@ -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")
}