-
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.
- Loading branch information
1 parent
04a8f0e
commit 0190e50
Showing
2 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# cd into root of project | ||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
root_dir="$(dirname "$script_dir")" | ||
cd "$root_dir" | ||
|
||
# Determine the operating system | ||
case "$OSTYPE" in | ||
darwin*) # macOS: activate virtual environment using bin/activate | ||
venv_activate_path="flask-env/bin/activate" | ||
open_command="open" | ||
;; | ||
linux*) # Linux: activate virtual environment using bin/activate | ||
venv_activate_path="flask-env/bin/activate" | ||
open_command="xdg-open" | ||
;; | ||
msys*) # Windows: activate virtual environment using Scripts/activate | ||
venv_activate_path="flask-env/Scripts/activate" | ||
open_command="start" | ||
;; | ||
*) echo "Unsupported operating system" ;; | ||
esac | ||
|
||
# Create and activate the virtual environment | ||
python3 -m venv flask-env | ||
source "$venv_activate_path" | ||
pip install -r requirements.txt | ||
|
||
# Launch flask | ||
$open_command "http://127.0.0.1:5000" | ||
flask --app server run --debug |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# Get the root directory of the project | ||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
root_dir="$(dirname "$script_dir")" | ||
cd "$root_dir" | ||
|
||
# Determine the operating system | ||
case "$OSTYPE" in | ||
darwin*) # macOS: activate virtual environment using bin/activate | ||
venv_activate_path="flask-env/bin/activate" | ||
open_command="open" | ||
;; | ||
linux*) # Linux: activate virtual environment using bin/activate | ||
venv_activate_path="flask-env/bin/activate" | ||
open_command="xdg-open" | ||
;; | ||
msys*) # Windows: activate virtual environment using Scripts/activate | ||
venv_activate_path="flask-env/Scripts/activate" | ||
open_command="start" | ||
;; | ||
*) echo "Unsupported operating system" ;; | ||
esac | ||
|
||
# Activate the virtual environment | ||
source "$venv_activate_path" | ||
|
||
# Launch Flask in a new terminal window | ||
$open_command "http://127.0.0.1:5000" | ||
flask --app server run --debug |