Skip to content

Commit 477b141

Browse files
committed
Fix check for if the user decides against copying the plugin into the plugins directory and when it does not yet exist in the plugins directory
1 parent 24d6264 commit 477b141

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ function Compile-SourceScript {
215215
}
216216

217217
# Alert the user on the situation of the plugin
218-
$updatedPlugin = Get-Item -Path "$PLUGINS_DIR/$($_.Name)"
218+
$updatedPlugin = Get-Item -Path "$PLUGINS_DIR/$($_.Name)" -ErrorAction SilentlyContinue
219+
if (!$updatedPlugin) { "`n Plugin does not exist in the plugins directory." | Write-Host -ForegroundColor Magenta; return }
219220
$updatedPluginHash = (Get-FileHash -Path $updatedPlugin -Algorithm MD5).Hash
220221
if ($updatedPluginHash -eq $compiledPluginHash) { "`n Plugin successfully copied to '$($_.Fullname)'" | Write-Host -ForegroundColor Green }
221222
else { "`n Failed to copy to the plugins directory." | Write-Host -ForegroundColor Magenta; return }

0 commit comments

Comments
 (0)