Browse Source

Ensure that leading slash is added to package's original path. Fixes #18.

package-creation-fix
Stanislav Nikitin 5 months ago
parent
commit
68ad99b767
Signed by: pztrn <pztrn@pztrn.name> GPG Key ID: 106900B32F8192EE
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      domains/client/v1/packages.go

+ 6
- 0
domains/client/v1/packages.go View File

@@ -56,6 +56,12 @@ func SetPackage(args []string, options map[string]string) {
VCS: args[3],
}

// Execute some necessary checks.
// If package's original path isn't starting with "/" - add it.
if !strings.HasPrefix(pkg.OriginalPath, "/") {
pkg.OriginalPath = "/" + pkg.OriginalPath
}

log.Info().Str("description", pkg.Description).Str("original path", pkg.OriginalPath).Str("real path", pkg.RealPath).Str("VCS", pkg.VCS).Msg("Sending set/update request to giredored...")

url := "http://" + options["server"] + "/_api/packages"


Loading…
Cancel
Save