Skip to content

Commit 21cc3a1

Browse files
committed
Improve error message for if the plugin compiler cannot be found
1 parent 8044496 commit 21cc3a1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Compile-SourceScript/Public/Compile-SourceScript.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ function Compile-SourceScript {
103103
}
104104
$SCRIPTING_DIR = $sourceFile.DirectoryName
105105
$COMPILED_DIR = Join-Path $SCRIPTING_DIR $MOD[$MOD_NAME]['compiled_dir_name']
106+
$COMPILER_PATH = Join-Path $SCRIPTING_DIR $COMPILER_NAME
106107
$PLUGINS_DIR = Join-Path (Split-Path $SCRIPTING_DIR -Parent) $MOD[$MOD_NAME]['plugins_dir_name']
107108

108109
# Verify the presence of the compiler item
109-
$compiler = Get-Item -Path (Join-Path $SCRIPTING_DIR $COMPILER_NAME)
110+
$compiler = Get-Item -Path $COMPILED_DIR -ErrorAction SilentlyContinue
111+
if (!$compiler) {
112+
throw "Cannot find the plugin compiler at the path '$COMPILER_PATH'."
113+
}
110114

111115
}catch {
112116
Write-Error -Exception $_.Exception -Message $_.Exception.Message -Category $_.CategoryInfo.Category -TargetObject $_.TargetObject

0 commit comments

Comments
 (0)