-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathomsummary-sleep.cmd
63 lines (45 loc) · 1.02 KB
/
omsummary-sleep.cmd
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
@echo off
setlocal
if not exist "%~dp0omsummary.exe" goto notfound_exe
if "%~1"=="" goto usage
:run
set FILE=%~dpnx1
if not exist "%FILE%" goto notfound_file
if not "%FILE:~-10%"==".sleep.csv" goto invalid_file
set TIMES=%FILE:~0,-10%.sleep.times.csv
if not exist "%TIMES%" goto notfound_times
set OUTPUT=%FILE:~0,-10%.sleep.summary.csv
echo --- %FILE% ---
echo on
"%~dp0omsummary.exe" -mode:sleep -in "%FILE%" -times "%TIMES%" -out "%OUTPUT%"
@echo off
echo ----------
shift
if not "%1"=="" goto run
goto done
:usage
echo.No files specified -- drag files on to this program.
pause
goto end
:notfound_exe
echo.Executable file not found: "%~dp0omsummary.exe"
pause
goto end
:invalid_file
echo ERROR: Input sleep file not of expected name (.sleep.csv): %FILE%
pause
goto end
:notfound_file
echo ERROR: Input sleep file not found: %FILE%
pause
goto end
:notfound_times
echo ERROR: Times file not found: %TIMES%
pause
goto end
:done
echo.
echo Done!
pause
goto end
:end