Skip to content

fix: align Windows destroy.bat behavior with bash destroy script (fixes #342)#399

Merged
pradeeban merged 1 commit into
ControlCore-Project:devfrom
GaneshPatil7517:fix/windows-destroy-consistency
Feb 19, 2026
Merged

fix: align Windows destroy.bat behavior with bash destroy script (fixes #342)#399
pradeeban merged 1 commit into
ControlCore-Project:devfrom
GaneshPatil7517:fix/windows-destroy-consistency

Conversation

@GaneshPatil7517
Copy link
Copy Markdown
Contributor

@GaneshPatil7517 GaneshPatil7517 commented Feb 18, 2026

Hi pradeeban Sir,

Fixes #342.

This PR updates destroy.bat so its behavior matches the bash destroy script.

Previously destroy.bat only checked whether stop.bat existed and then immediately deleted the study directory. It did not actually run stop.bat or clear.bat. Because of this, Docker containers or background processes could remain running, and volumes or files could be left behind.

This change makes the Windows script follow the same order as the bash version.

Changes in this PR:

  • Added a check to make sure the directory exists
  • Added an explicit call to stop.bat before deletion
  • Added a conditional call to clear.bat (if the file exists)
  • After cleanup, the directory is removed using rmdir /s /q
  • Existing validation logic for rejecting non-study directories is kept
  • Batch files are executed using proper call semantics

The result is that Windows now follows the same flow as bash:

stop → clear → delete

Scope:

  • Single file modified: destroy.bat
  • No changes to the bash destroy script
  • No changes to any other files

Testing done locally on Windows:

  1. Non-existent directory → error message, exit code 1
  2. Directory without stop.bat (not a concore study) → error message, exit code 1
  3. Valid study with stop.bat and clear.bat → stop runs → clear runs → directory removed
  4. Valid study with only stop.bat → stop runs → directory removed (clear skipped)

All tests passed.

Copilot AI review requested due to automatic review settings February 18, 2026 07:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug in the Windows destroy.bat script where it was only checking for the existence of stop.bat but not actually executing it or clear.bat before deleting the study directory. This left Docker containers running, processes active, and volumes dangling on Windows systems.

Changes:

  • Fixed destroy.bat to properly execute stop.bat and clear.bat before directory deletion, aligning with bash destroy script behavior
  • Added proper error handling with directory existence checks and appropriate exit codes
  • Improved path handling with proper quoting for spaces

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pradeeban pradeeban merged commit 4f8b2d9 into ControlCore-Project:dev Feb 19, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants