fix: explicitly check schemas
This commit is contained in:
parent
ef7f8cc8e8
commit
47615c3325
2 changed files with 1 additions and 8 deletions
|
@ -31,8 +31,6 @@ func FromPath(path string) (Disk, error) {
|
||||||
return nil, errors.Wrap(err, "failed to parse path")
|
return nil, errors.Wrap(err, "failed to parse path")
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info().Msg(path)
|
|
||||||
log.Info().Msg(parsed.Scheme)
|
|
||||||
switch parsed.Scheme {
|
switch parsed.Scheme {
|
||||||
case "ftp":
|
case "ftp":
|
||||||
log.Info().Str("path", path).Msg("connecting to ftp")
|
log.Info().Str("path", path).Msg("connecting to ftp")
|
||||||
|
|
|
@ -116,7 +116,7 @@ func (i *Installations) AddInstallation(ctx *GlobalContext, installPath string,
|
||||||
}
|
}
|
||||||
|
|
||||||
var absolutePath = installPath
|
var absolutePath = installPath
|
||||||
if parsed.Scheme == "" {
|
if parsed.Scheme != "ftp" && parsed.Scheme != "sftp" {
|
||||||
absolutePath, err = filepath.Abs(installPath)
|
absolutePath, err = filepath.Abs(installPath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -129,11 +129,6 @@ func (i *Installations) AddInstallation(ctx *GlobalContext, installPath string,
|
||||||
Profile: profile,
|
Profile: profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
// ftp://one:1234@localhost:21/
|
|
||||||
|
|
||||||
log.Info().Msg("installPath: " + installPath)
|
|
||||||
log.Info().Msg("absolutePath: " + absolutePath)
|
|
||||||
|
|
||||||
if err := installation.Validate(ctx); err != nil {
|
if err := installation.Validate(ctx); err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to validate installation")
|
return nil, errors.Wrap(err, "failed to validate installation")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue