forked from docToolchain/diagrams.net-intellij-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dtcw
51 lines (48 loc) · 1.48 KB
/
dtcw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
mainConfigFile=config.groovy
# check if CLI, docker or sdkman are installed
cli=false
docker=false
sdkman=false
if command -v doctoolchain &> /dev/null; then
echo "docToolchain as CLI available"
cli=true
fi
if command -v docker &> /dev/null; then
echo "docker available"
docker=true
if [ "$1" = "docker" ] ; then
cli=false
echo "force use of docker"
unset 1
fi
fi
if command -v sdk &> /dev/null; then
echo "sdkamn available"
sdkman=true
fi
if [ "$cli" = true ] ; then
command="doctoolchain . $1 $2 $3 $4 $5 $6 $7 $8 $9 --info"
else
if [ "$docker" = true ] ; then
docker_cmd=$(which docker)
echo $docker_cmd
command="$docker_cmd run --rm -it --entrypoint /bin/bash -v ${PWD}:/project rdmueller/doctoolchain:rc-1.2.0 -c \"doctoolchain . $1 $2 $3 $4 $5 $6 $7 $8 $9 --info && exit\""
echo $command
else
echo "docToolchain not installed."
if [ "$sdkman" = true ] ; then
echo "please use sdkman to install docToolchain"
echo "$ sdk install doctoolchain 1.2.0-beta"
exit
else
echo "you need docToolchain as CLI-Tool installed or docker."
echo "to install docToolchain as CLI-Tool, please install"
echo "sdkman and re-run this command."
echo "https://sdkman.io/install"
echo "$ curl -s "https://get.sdkman.io" | bash"
exit
fi
fi
fi
bash -cl "$command"