Skip to content

Commit 3137105

Browse files
committed
Merge branch 'refactor/improve-check-for-plugin-copy-failures'
2 parents 24d6264 + 9f484a4 commit 3137105

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ 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 }
221-
else { "`n Failed to copy to the plugins directory." | Write-Host -ForegroundColor Magenta; return }
222+
else { "`n Failed to update existing plugin in the plugins directory." | Write-Host -ForegroundColor Magenta; return }
222223
}
223224

224225
# Throw an error if the copying process failed

0 commit comments

Comments
 (0)