-
Notifications
You must be signed in to change notification settings - Fork 1
/
eclrun.bat
47 lines (35 loc) · 958 Bytes
/
eclrun.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
@echo off
rem Get the root path of current batch script.
set rootdir=%~dp0
rem Check whether ECL is available.
%rootdir%\ecl2.exe --version 2>nul 1>&2 || (
echo No ECL on the system >&2
exit /B 1
)
rem Get the path of a Lisp script from first argument.
set script=%1
rem Check whether the Lisp script is valid.
rem Run in batch mode if %script% is a file.
if exist %script% goto batch_mode
rem Fallback to interactive mode.
goto interactive_mode
:batch_mode
rem Consume one argument, which is %script%
shift
set args=
:collect_args
set arg=%1
if not "x%arg%" == "x" (
set args=%args% %arg%
rem Consume one more argument.
shift
goto collect_args
)
%rootdir%\ecl2.exe ^
--eval "(load (concatenate 'string (ext:getenv \"USERPROFILE\") \"/\" \".eclrc\"))" ^
--encoding ":utf-8" ^
--shell %script% %args%
rem Exit the program with inherited return value.
exit /B %ERRORLEVEL%
:interactive_mode
%rootdir%\ecl2.exe %*