Skip to content

Commit 734e9f3

Browse files
committed
fix debug rider not stop when process acad running
1 parent 2454fc3 commit 734e9f3

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

CADPythonShell/postbuild.ps1

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@ Write-Host "Project Directory:" $ProjectDir
55
Write-Host "Configuration Name Current:" $Configuration
66
$bundle = "C:\ProgramData\Autodesk\ApplicationPlugins\CADPythonShell.bundle\"
77
$content = "PackageContents.xml"
8+
$AutodeskProcessName = "acad"
89
if($Configuration -match "Debug"){
9-
Write-Host "************Start Create Folder And Check File \(^.^)/"
10-
if(Test-Path $bundle){
11-
Write-Host "Exits Path, So Remove All File Exits"
12-
Remove-Item ($bundle) -Recurse
13-
Write-Host "Removed All File Exist"
10+
$proc = Get-Process $AutodeskProcessName -ErrorAction SilentlyContinue
11+
if($proc)
12+
{
13+
Write-Host "Warning : Please Close Autocad Or Civil3D To Auto Copy Resouce And Debug \(^_^)/"
1414
}
15-
Write-Host "************ Start Copy New File"
16-
xcopy ($SolutionDir + $content) $bundle /Y
17-
xcopy ($ProjectDir + "*.*") $bundle /Y /I /E /R
18-
Write-Host "************ Oh my got ! Copy Complete! Chuongmep.com \(^_^)/"
15+
else
16+
{
17+
Write-Host "************Start Create Folder And Check File \(^.^)/"
18+
if(Test-Path $bundle){
19+
Write-Host "Exits Path, So Remove All File Exits"
20+
Remove-Item ($bundle) -Recurse
21+
Write-Host "Removed All File Exist"
22+
}
23+
Write-Host "************ Start Copy New File"
24+
xcopy ($SolutionDir + $content) $bundle /Y
25+
xcopy ($ProjectDir + "*.*") $bundle /Y /I /E /R
26+
Write-Host "************ Oh my got ! Copy Complete! Chuongmep.com \(^_^)/"
27+
}
28+
1929
}
2030
else
2131
{

0 commit comments

Comments
 (0)