File: git-cl.cmd

package info (click to toggle)
opentelemetry-cpp 1.23.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,372 kB
  • sloc: cpp: 96,239; sh: 1,766; makefile: 36; python: 31
file content (23 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
REM Copyright The OpenTelemetry Authors
REM SPDX-License-Identifier: Apache-2.0

@echo off
setlocal enabledelayedexpansion
if "%1" == "format" (
  if NOT "%2" == "" (
    where clang-format > NUL
    if %ERRORLEVEL% neq 0 (
      echo clang-format.exe not found in PATH!
      echo Assuming default path for LLVM tools...
      set PATH="C:\Program Files\LLVM\bin;!PATH!"
    )
    REM Assume if file exists - it's a full path, else - it's a path relative to git root.
    if exist %2 (
      set "FILEPATH=%2"
    ) else (
      set "FILEPATH=%GIT_PREFIX%%2"
    )
    clang-format -style=file -i --verbose !FILEPATH!
  )
)
endlocal