Skip to content

Commit

Permalink
fix just for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Turcan committed Oct 29, 2024
1 parent 8a82446 commit fd1f4f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions docker/containers.just
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default:
[no-cd]
check:
# If the system is Linux or macOS, execute the check with bash.
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
if ! docker ps | grep -q "examples"; then \
echo "Docker environment is not running. Starting environment..."; \
just containers start; \
Expand All @@ -20,7 +20,7 @@ check:
# Builds the Docker containers using Docker Compose
[no-cd]
build:
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Building Docker containers..."; \
python ./docker/nexusctl.py create; \
else \
Expand All @@ -30,7 +30,7 @@ build:
# Starts the Docker containers using Docker Compose
[no-cd]
start:
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Starting Docker containers..."; \
python ./docker/nexusctl.py start; \
else \
Expand All @@ -40,7 +40,7 @@ start:
# Stops the Docker containers using Docker Compose
[no-cd]
stop:
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Stopping Docker containers..."; \
python ./docker/nexusctl.py stop; \
else \
Expand All @@ -50,7 +50,7 @@ stop:
# Deletes all Docker volumes related to the project using Docker Compose
[no-cd]
clean:
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Deleting Docker volumes..."; \
python ./docker/nexusctl.py delete; \
else \
Expand Down
6 changes: 3 additions & 3 deletions examples/example.just
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default:
# Runs an example that prompts the user for a description of their post.
[no-cd]
ig-post-planner:
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
just containers check && \
docker exec -it examples /bin/bash -c "source .venv/bin/activate && python examples/main.py ig_post_planner"; \
else \
Expand All @@ -16,7 +16,7 @@ ig-post-planner:
# Runs an example that prompts the user for description of their trip.
[no-cd]
trip-planner:
if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
just containers check && \
docker exec -it examples /bin/bash -c "source .venv/bin/activate && python examples/main.py trip_planner"; \
else \
Expand All @@ -28,7 +28,7 @@ trip-planner:
# Runs an example that prompts the user for description of their cluster.
[no-cd]
cli-cluster:
@if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
@if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
just containers check && \
docker exec -it examples /bin/bash -c "source .venv/bin/activate && python examples/main.py cli_cluster"; \
else \
Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod containers 'docker/containers.just'

# Opens a Python shell inside the Docker container
interactive-shell:
if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Opening an interactive Python shell in the Docker container..."; \
docker exec -it examples /bin/bash -c "source .venv/bin/activate && ptpython"; \
else \
Expand All @@ -23,7 +23,7 @@ interactive-shell:

# Builds and starts the entire environment
environment-up:
if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Building and starting the entire environment..."; \
python ./docker/nexusctl.py create; \
python ./docker/nexusctl.py start; \
Expand All @@ -33,7 +33,7 @@ environment-up:

# Shuts down and cleans up the environment
environment-down:
if [[ {{os()}} == "Linux" ]] || [[ {{os()}} == "macos" ]]; then \
if [[ {{os()}} == "linux" ]] || [[ {{os()}} == "macos" ]]; then \
echo "Stopping and cleaning up the entire environment..."; \
python ./docker/nexusctl.py stop; \
python ./docker/nexusctl.py delete; \
Expand Down

0 comments on commit fd1f4f3

Please sign in to comment.