Skip to content

Commit

Permalink
feat: library path messages
Browse files Browse the repository at this point in the history
print library message during plan (and therefore also install)
will now error if no library specified. This was a bug
introduced when relaxing the strict mode requirement
as library path used to be required, however when making it
optional, if people now include no library or lockfile type
pkgr would not do the right thing

closes: #239 #237
  • Loading branch information
Devin Pastoor committed Mar 14, 2020
1 parent d197983 commit 975bbdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ func planInstall(rv cran.RVersion, exitOnMissing bool) (*cran.PkgNexus, gpsr.Ins
"to_install": toInstall,
"to_update": pkgsToUpdateCount,
}).Info("package installation plan")
log.Infof("Library path to install packages: %s\n", cfg.Library)

if toInstall > 0 && toInstall != totalPackagesRequired {
// log which packages to install, but only if doing an incremental install
Expand Down
3 changes: 3 additions & 0 deletions configlib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func getLibraryPath(lockfileType string, rpath string, rversion cran.RVersion, p
case "pkgr":
default:
}
if library == "" {
log.Fatal("must specify either a Lockfile Type or Library path")
}
return library
}

Expand Down

0 comments on commit 975bbdf

Please sign in to comment.