Resolve check and freshen paths against the manifest's directory (closes #177)
check / check (push) Waiting to run

Without --base, check and freshen now look for a manifest's files in the
directory that holds the manifest, the file named or the one found in a
directory argument, instead of the current directory. check of a manifest
given by URL still uses the current directory, and a --base given on the
command line, the current directory included, still overrides. The --base
help text of both commands and the README's Tool Examples state the
default; the README gains a freshen entry to do so.

Model: opus-5-5
This commit is contained in:
2026-10-07 14:12:53 +00:00
parent dce5e050c3
commit 256881c571
6 changed files with 148 additions and 8 deletions
+11 -1
View File
@@ -299,6 +299,17 @@ func (mfa *CLIApp) checkManifestOperation(
return fmt.Errorf("check: %w", err)
}
// Without --base, the manifest's paths are resolved against the
// directory holding it, or the current directory for a manifest URL.
basePath := "."
switch {
case cmd.IsSet(flagBase):
basePath = cmd.String(flagBase)
case !isHTTPURL(manifestPath):
basePath = filepath.Dir(manifestPath)
}
// URL manifests need to be downloaded to a temp file for the checker
if isHTTPURL(manifestPath) {
tmpPath, tmpErr := mfa.fetchManifestToTemp(ctx, manifestPath)
@@ -311,7 +322,6 @@ func (mfa *CLIApp) checkManifestOperation(
manifestPath = tmpPath
}
basePath := cmd.String("base")
showProgress := cmd.Bool("progress")
log.Infof("checking manifest %s with base %s", manifestPath, basePath)