forked from typedb/typedb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grakn.bat
81 lines (63 loc) · 2.53 KB
/
grakn.bat
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@echo off
REM
REM GRAKN.AI - THE KNOWLEDGE GRAPH
REM Copyright (C) 2018 Grakn Labs Ltd
REM
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU Affero General Public License as
REM published by the Free Software Foundation, either version 3 of the
REM License, or (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU Affero General Public License for more details.
REM
REM You should have received a copy of the GNU Affero General Public License
REM along with this program. If not, see <https://www.gnu.org/licenses/>.
REM
SET "GRAKN_HOME=%cd%"
SET GRAKN_CONFIG="conf\grakn.properties"
where java >NUL 2>NUL
if %ERRORLEVEL% GEQ 1 (
echo Java is not installed on this machine.
echo Grakn needs Java 1.8 in order to run. See the following setup guide: http://dev.grakn.ai/docs/get-started/setup-guide
pause
exit 1
)
if "%1" == "" goto missingargument
if "%1" == "console" goto startconsole
if "%1" == "server" goto startserver
echo Invalid argument: %1. Possible commands are:
echo Server: grakn server [--help]
echo Console: grakn console [--help]
goto exiterror
:missingargument
echo Missing argument. Possible commands are:
echo Server: grakn server [--help]
echo Console: grakn console [--help]
goto exiterror
:startconsole
if exist .\services\lib\core.console-*.jar (
set "G_CP=%GRAKN_HOME%\conf\;%GRAKN_HOME%\services\grakn\client;%GRAKN_HOME%\services\lib\*"
java -cp "%G_CP%" -Dgrakn.dir="%GRAKN_HOME%" -Dgrakn.conf="%GRAKN_HOME%/%GRAKN_CONFIG%" -Dserver.javaopts="%SERVER_JAVAOPTS%" grakn.core.console.GraknConsole %*
goto exit
) else (
echo Grakn Core Console is not included in this Grakn distribution^.
echo You may want to install Grakn Core Console or Grakn Core ^(all^)^.
goto exiterror
)
:startserver
if exist .\services\lib\core.server-*.jar (
set "G_CP=%GRAKN_HOME%\conf\;%GRAKN_HOME%\services\grakn\server;%GRAKN_HOME%\services\lib\*"
java -cp "%G_CP%" -Dgrakn.dir="%GRAKN_HOME%" -Dgrakn.conf="%GRAKN_HOME%/%GRAKN_CONFIG%" -Dserver.javaopts="%SERVER_JAVAOPTS%" grakn.core.daemon.GraknDaemon %*
goto exit
) else (
echo Grakn Core Server is not included in this Grakn distribution^.
echo You may want to install Grakn Core Server or Grakn Core ^(all^)^.
goto exiterror
)
:exit
exit /b 0
:exiterror
exit /b 1