-
Notifications
You must be signed in to change notification settings - Fork 0
Add launcher scripts #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| @echo off | ||
| echo Starting Python Learning App... | ||
| echo Syncing dependencies... | ||
| call uv sync --group dev | ||
| if %errorlevel% neq 0 ( | ||
| echo Error syncing dependencies. Make sure 'uv' is installed. | ||
| pause | ||
| goto :eof | ||
| ) | ||
|
|
||
| echo Launching app... | ||
| call uv run python-learning session | ||
| if %errorlevel% neq 0 ( | ||
| pause | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| Write-Host "Starting Python Learning App..." -ForegroundColor Cyan | ||
|
|
||
| Write-Host "Syncing dependencies..." -ForegroundColor Yellow | ||
| try { | ||
| uv sync --group dev | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "uv sync failed with exit code $LASTEXITCODE" | ||
| } | ||
| } catch { | ||
| Write-Host "Error syncing dependencies. Make sure 'uv' is installed." -ForegroundColor Red | ||
| Write-Host $_.Exception.Message -ForegroundColor Red | ||
| Read-Host "Press Enter to quit..." | ||
| return | ||
| } | ||
|
|
||
| Write-Host "Launching app..." -ForegroundColor Green | ||
| uv run python-learning session | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Read-Host "Press Enter to quit..." | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Text formatting | ||
| CYAN="\033[0;36m" | ||
| YELLOW="\033[1;33m" | ||
| GREEN="\033[0;32m" | ||
| RED="\033[0;31m" | ||
| NC="\033[0m" # No Color | ||
|
|
||
| echo -e "${CYAN}Starting Python Learning App...${NC}" | ||
|
|
||
| echo -e "${YELLOW}Syncing dependencies...${NC}" | ||
| if ! uv sync --group dev; then | ||
| echo -e "${RED}Error syncing dependencies. Make sure 'uv' is installed.${NC}" | ||
| read -p "Press Enter to quit..." | ||
| kill -INT $$ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| fi | ||
|
|
||
| echo -e "${GREEN}Launching app...${NC}" | ||
| if ! uv run python-learning session; then | ||
| read -p "Press Enter to quit..." | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| kill -INT $$ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the application fails to launch, the script pauses without any message, which could be confusing for the user. It's better to provide an error message indicating that the application exited with an error before pausing.