From fa0fc91cd7d8a8f54d47f58eaf247489256252f0 Mon Sep 17 00:00:00 2001 From: Genuchten Date: Wed, 21 Jun 2023 11:56:12 +0200 Subject: [PATCH] remove shopt&alias to make it work on powershell syntax: bash geopython-workshop-ctl.sh start --- README.md | 2 +- workshop/geopython-workshop-ctl.sh | 26 +++----------------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 14d85b9..215724e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Docker-Volume-mounted. There is no need to build the Docker Image yourself (see All services are started using a [Docker Compose file](https://github.com/geopython/geopython-workshop/blob/master/workshop/docker-compose.yml). -Windows users; use [powershell](https://en.wikipedia.org/wiki/PowerShell) or [Linux Subsystem](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) to run below commands. +Windows users; use [powershell](https://en.wikipedia.org/wiki/PowerShell) or [Linux Subsystem](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) to run below commands. On powershell call the shell script by prepending `bash`, eg. `bash ./geopython-workshop-ctl.sh start`. ```bash cd workshop diff --git a/workshop/geopython-workshop-ctl.sh b/workshop/geopython-workshop-ctl.sh index eb41e4b..7d785bb 100755 --- a/workshop/geopython-workshop-ctl.sh +++ b/workshop/geopython-workshop-ctl.sh @@ -1,7 +1,5 @@ #!/bin/bash -shopt -s expand_aliases - PROGRAM_NAME=$(basename $0) USAGE="Usage: $PROGRAM_NAME " @@ -11,31 +9,13 @@ if [ "$#" -ne 1 ]; then exit 1 fi -# Sniff which Docker Compose variant is installed -# and set an alias. -# See https://github.com/geopython/geopython-workshop/issues/82 -if command docker-compose --version &> /dev/null -then - alias dockercompose='docker-compose' - echo "Using docker-compose" -else - if !command docker compose version &> /dev/null - then - echo "Neither docker-compose nor docker compose is available" - echo "Check your Docker Installation" - exit 1 - fi - alias dockercompose='docker compose' - echo "Using docker compose" -fi - # Test for the command if [ $1 == "start" ]; then $0 stop - dockercompose up -d + docker compose up -d elif [ $1 == "stop" ]; then - dockercompose stop - dockercompose rm --force + docker compose stop + docker compose rm --force elif [ $1 == "url" ]; then # try to open the Jupyter Notebook in Browser platform="$(uname | tr '[:upper:]' '[:lower:]')"