Skip to content

Commit fa0fc91

Browse files
author
Genuchten
committed
remove shopt&alias to make it work on powershell
syntax: bash geopython-workshop-ctl.sh start
1 parent 1f1a37b commit fa0fc91

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Docker-Volume-mounted. There is no need to build the Docker Image yourself (see
2222

2323
All services are started using a [Docker Compose file](https://github.com/geopython/geopython-workshop/blob/master/workshop/docker-compose.yml).
2424

25-
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.
25+
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`.
2626

2727
```bash
2828
cd workshop

workshop/geopython-workshop-ctl.sh

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
shopt -s expand_aliases
4-
53
PROGRAM_NAME=$(basename $0)
64

75
USAGE="Usage: $PROGRAM_NAME <start|stop|url|update|clean>"
@@ -11,31 +9,13 @@ if [ "$#" -ne 1 ]; then
119
exit 1
1210
fi
1311

14-
# Sniff which Docker Compose variant is installed
15-
# and set an alias.
16-
# See https://github.com/geopython/geopython-workshop/issues/82
17-
if command docker-compose --version &> /dev/null
18-
then
19-
alias dockercompose='docker-compose'
20-
echo "Using docker-compose"
21-
else
22-
if !command docker compose version &> /dev/null
23-
then
24-
echo "Neither docker-compose nor docker compose is available"
25-
echo "Check your Docker Installation"
26-
exit 1
27-
fi
28-
alias dockercompose='docker compose'
29-
echo "Using docker compose"
30-
fi
31-
3212
# Test for the command
3313
if [ $1 == "start" ]; then
3414
$0 stop
35-
dockercompose up -d
15+
docker compose up -d
3616
elif [ $1 == "stop" ]; then
37-
dockercompose stop
38-
dockercompose rm --force
17+
docker compose stop
18+
docker compose rm --force
3919
elif [ $1 == "url" ]; then
4020
# try to open the Jupyter Notebook in Browser
4121
platform="$(uname | tr '[:upper:]' '[:lower:]')"

0 commit comments

Comments
 (0)