File: code-format.bat

package info (click to toggle)
shadowsocks-libev 3.3.5%2Bds-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,496 kB
  • sloc: ansic: 14,124; sh: 1,338; makefile: 197; python: 111
file content (35 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (5)
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
@echo off

set root=%~dp0
set source=%root%src

goto start

:format
set filelist=%1
for /r "%filelist%" %%f in (*) do (
  if "%%~xf" equ ".h" (
    call :format_file %%f
  ) else if "%%~xf" equ ".c" (
    call :format_file %%f
  )
)
goto end

:format_file
set f=%1
if "%~n1" neq "base64" (
  if "%~n1" neq "json" (
    if "%~n1" neq "uthash" (
      echo 'format file "%f%"'
      uncrustify -c %root%\.uncrustify.cfg -l C --replace --no-backup %f%
      DEL %~dp1*.uncrustify >nul 2>nul
    )
  )
)
goto end

:start
call :format %source%

:end