mirror of
https://github.com/apple/pkl.git
synced 2026-04-28 03:07:14 +02: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-dependency-notation]]
|
||||||
=== CLI Support for 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:
|
This is especially helpful for <<cli-framework,CLI commands>> defined in Packages:
|
||||||
|
|
||||||
[source,bash]
|
[source,bash]
|
||||||
|
|||||||
@@ -111,9 +111,10 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
|
|||||||
remoteDep.packageUri.toPackageAssetUri(path).uri
|
remoteDep.packageUri.toPackageAssetUri(path).uri
|
||||||
}
|
}
|
||||||
|
|
||||||
protected val resolvedSourceModules: List<URI> =
|
protected val resolvedSourceModules: List<URI> by lazy {
|
||||||
if (project == null) cliOptions.normalizedSourceModules
|
if (project == null) cliOptions.normalizedSourceModules
|
||||||
else cliOptions.normalizedSourceModules.map(::resolveModuleUri)
|
else cliOptions.normalizedSourceModules.map(::resolveModuleUri)
|
||||||
|
}
|
||||||
|
|
||||||
protected fun loadProject(projectFile: Path): Project {
|
protected fun loadProject(projectFile: Path): Project {
|
||||||
val securityManager =
|
val securityManager =
|
||||||
|
|||||||
Reference in New Issue
Block a user