summaryrefslogtreecommitdiff
path: root/tools/build_scripts/fixme.cmd
blob: 490a43c619a9a049d635cad548daa2c3bb958a5c (plain)
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
@echo off

for /F "tokens=1,2 delims==" %%a in ('findstr "ProfileDir=" mirandaboot.ini') do (
  call set ProfileDir=%%b
)

if "%ProfileDir%"=="" set ProfileDir=%~dp0Profiles

echo Using profile directory %ProfileDir%

if "%1" == "" (
  pushd "%ProfileDir%"

  for /D %%i in (*) do (
    if exist "%%i\%%i.dat" set ProfileName=%%i
  )

  popd

  if "!ProfileName!" == "" (
     echo No default profile found, exiting
     goto :eof
  )

) else (
  if not exist "%ProfileDir%\%1\%1.dat" (
    echo Wrong profile name specified: %1
    goto :eof
  )

  set ProfileName=%1
)

set FullProfileName=%ProfileDir%\%ProfileName%\%ProfileName%.dat

del "%FullProfileName%.bak" > nul
copy "%FullProfileName%" "%FullProfileName%.bak"

mdbx_chk.exe -i -w -v -t -1 "%FullProfileName%"

echo Operation succeeded
goto :eof