Skip to content

Commit 7e74d09

Browse files
committed
Add --upgrade (-U | -u | upgrade) to CLI scripts
1 parent 6ca98ad commit 7e74d09

File tree

6 files changed

+65
-9
lines changed

6 files changed

+65
-9
lines changed

mathics_omnibus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# well as importing into Python. That's why there is no
66
# space around "=" below.
77
# fmt: off
8-
__version__="3.1.0" # noqa
8+
__version__="3.1.1.dev0" # noqa

script/dmathics

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
#!/bin/bash
2+
set -e
3+
if [ -n "$DEBUG" ]; then
4+
set -x
5+
fi
6+
27
DOCKER=${DOCKER:-docker}
38

49
TAG=${TAG:-latest}
510
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
611

12+
for arg in "$@" ; do
13+
case "$arg" in
14+
-u | -U | --upgrade | upgrade)
15+
$DOCKER pull $MATHICS_IMAGE
16+
exit $?
17+
;;
18+
esac
19+
done
20+
721
$DOCKER run --rm -it --name mathics-cli -v /tmp:/usr/src/app/data $MATHICS_IMAGE --mode mathics -- $@

script/dmathicsdoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23
if [ -n "$DEBUG" ]; then
34
set -x
45
fi
@@ -9,6 +10,15 @@ DOCKER=${DOCKER:-docker}
910
TAG=${TAG:-latest}
1011
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
1112

13+
for arg in $@ ; do
14+
case "$arg" in
15+
-u | --upgrade | upgrade)
16+
$DOCKER pull $MATHICS_IMAGE
17+
exit $?
18+
;;
19+
esac
20+
done
21+
1222
$DOCKER run -it \
1323
--name mathics-doc \
1424
--rm \

script/dmathicsdoccopy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23
if [ -n "$DEBUG" ]; then
34
set -x
45
fi
@@ -9,6 +10,15 @@ DOCKER=${DOCKER:-docker}
910
TAG=${TAG:-latest}
1011
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
1112

13+
for arg in "$@" ; do
14+
case "$arg" in
15+
-u | -U | --upgrade | upgrade)
16+
$DOCKER pull $MATHICS_IMAGE
17+
exit $?
18+
;;
19+
esac
20+
done
21+
1222
$DOCKER run -it \
1323
--name mathics-copy \
1424
--rm \

script/dmathicsscript

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
#!/bin/bash
2+
set -e
23
if [ -n "$DEBUG" ]; then
34
set -x
45
fi
56

7+
# Allow customization using POSIX environment variables:
8+
DOCKER=${DOCKER:-docker}
9+
TAG=${TAG:-latest}
10+
11+
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
12+
13+
for arg in $@ ; do
14+
case "$arg" in
15+
-u | --upgrade | upgrade)
16+
$DOCKER pull $MATHICS_IMAGE
17+
exit $?
18+
;;
19+
esac
20+
done
21+
622
cd $(dirname ${BASH_SOURCE[0]})
723
source ./term-background.sh
824

@@ -18,19 +34,15 @@ else
1834
fi
1935

2036

21-
DOCKER=${DOCKER:-docker}
2237
XAUTH=${XAUTH:-$HOME/.Xauthority}
2338
touch $XAUTH
2439

25-
TAG=${TAG:-latest}
26-
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
27-
2840
DEVICE=''
2941
if [[ -r /dev/dri ]]; then
3042
DEVICE='--device=/dev/dri:/dev/dri'
3143
fi
3244

33-
$DOCKER run -it \
45+
$DOCKER run \
3446
--rm \
3547
--env "DISPLAY=$DISPLAY" \
3648
--name mathics-cli \

script/dmathicsserver

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
#!/bin/bash
2+
set -e
23
if [ -n "$DEBUG" ]; then
34
set -x
45
fi
56

7+
TAG=${TAG:-latest}
8+
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
9+
10+
for arg in "$@" ; do
11+
case "$arg" in
12+
-u | | -U | --upgrade | upgrade)
13+
$DOCKER pull $MATHICS_IMAGE
14+
exit $?
15+
;;
16+
esac
17+
done
18+
619
# Allow customization using POSIX environment variables:
720
DOCKER=${DOCKER:-docker}
821
MATHICS_DJANGO_DB=${MATHICS_DJANGO_DB:-"mathics.sqlite"}
922
MATHICS_DJANGO_DB_PATH=${MATHICS_DJANGO_DB_PATH:-/usr/src/app/.local/var/mathics/${MATHICS_DJANGO_DB}}
1023

11-
TAG=${TAG:-latest}
12-
MATHICS_IMAGE=${MATHICS_IMAGE:-mathicsorg/mathics:${TAG}}
13-
1424
$DOCKER run -it \
1525
--name mathics-web \
1626
--rm \

0 commit comments

Comments
 (0)