forked from SWE-agent/SWE-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prevent premature command execution in Codespaces
- Add setup status tracking script - Modify postcreate.sh to use status tracking - Add status checking in CLI - Update documentation with clearer setup instructions Fixes SWE-agent#354 Co-Authored-By: Erkin Alp Güney <[email protected]>
- Loading branch information
1 parent
0772c99
commit 425f751
Showing
4 changed files
with
85 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script manages the setup status for GitHub Codespaces | ||
# It creates and updates a status file that can be checked by the CLI | ||
|
||
set -euo pipefail | ||
|
||
STATUS_FILE="${HOME}/.swe_agent_setup_status" | ||
|
||
function mark_setup_started() { | ||
echo "setup_started" > "${STATUS_FILE}" | ||
chmod 644 "${STATUS_FILE}" # Ensure file is readable by all users | ||
} | ||
|
||
function mark_setup_complete() { | ||
echo "setup_complete" > "${STATUS_FILE}" | ||
chmod 644 "${STATUS_FILE}" # Ensure file is readable by all users | ||
} | ||
|
||
function mark_setup_failed() { | ||
echo "setup_failed" > "${STATUS_FILE}" | ||
chmod 644 "${STATUS_FILE}" # Ensure file is readable by all users | ||
} | ||
|
||
# Create status file if it doesn't exist | ||
touch "${STATUS_FILE}" | ||
chmod 644 "${STATUS_FILE}" # Ensure file is readable by all users | ||
|
||
case "${1:-}" in | ||
"start") | ||
mark_setup_started | ||
;; | ||
"complete") | ||
mark_setup_complete | ||
;; | ||
"failed") | ||
mark_setup_failed | ||
;; | ||
*) | ||
echo "Usage: $0 {start|complete|failed}" | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters