forked from sakura-editor/sakura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc-hash.bat
43 lines (40 loc) · 976 Bytes
/
calc-hash.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
set OUTHASHFILE=%1
set SRCDIR=%2
if "%OUTHASHFILE%" == "" (
call :showhelp %0
exit /b 1
)
if "%SRCDIR%" == "" (
call :showhelp %0
exit /b 1
)
if not exist "%SRCDIR%" (
@echo.
@echo "%SRCDIR%" does not exist.
@echo.
call :showhelp %0
exit /b 1
)
where python --version 1>nul 2>&1
if errorlevel 1 (
@echo NOTE: No python command
) else (
python calc-hash.py %OUTHASHFILE% %SRCDIR%
)
exit /b 0
@rem ------------------------------------------------------------------------------
@rem show help
@rem see http://orangeclover.hatenablog.com/entry/20101004/1286120668
@rem ------------------------------------------------------------------------------
:showhelp
@echo off
@echo usage
@echo %~nx1 "output hash file" "source directory"
@echo.
@echo parameter
@echo output hash file : filename of hash file
@echo source directory : source directory where target files are in
@echo.
@echo example
@echo %~nx1 sha256.txt sakura-buildLocal-Win32-Release
exit /b 0