mirror of
https://github.com/apple/pkl.git
synced 2026-02-26 04:14:57 +01:00
Fix regression in CLI error handling when project loading fails (#1439)
This commit is contained in:
@@ -196,7 +196,7 @@ image::syntax-highlight-error.png[syntax highlighted output]
|
||||
[[cli-dependency-notation]]
|
||||
=== CLI Support for Dependency Notation
|
||||
|
||||
The Pkl CLI now supports specifying modules using xref:language-reference:index.adoc#project-dependencies[dependency notation] (pr:https://github.com/apple/pkl/pull/1434[]).
|
||||
The Pkl CLI now supports specifying modules using xref:language-reference:index.adoc#project-dependencies[dependency notation] (pr:https://github.com/apple/pkl/pull/1434[], pr:https://github.com/apple/pkl/pull/1439[]).
|
||||
This is especially helpful for <<cli-framework,CLI commands>> defined in Packages:
|
||||
|
||||
[source,bash]
|
||||
|
||||
@@ -111,9 +111,10 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
|
||||
remoteDep.packageUri.toPackageAssetUri(path).uri
|
||||
}
|
||||
|
||||
protected val resolvedSourceModules: List<URI> =
|
||||
protected val resolvedSourceModules: List<URI> by lazy {
|
||||
if (project == null) cliOptions.normalizedSourceModules
|
||||
else cliOptions.normalizedSourceModules.map(::resolveModuleUri)
|
||||
}
|
||||
|
||||
protected fun loadProject(projectFile: Path): Project {
|
||||
val securityManager =
|
||||
|
||||
Reference in New Issue
Block a user