Forum

Count total lines o...
 
Powiadomienia
Wyczyść wszystko

Count total lines of code in project (git) using PHP + Windows

1 Wpisy
1 Użytkownicy
0 Reactions
829 Widoki
0
Rozpoczynający temat

powershell, cloc 

https://github.com/AlDanial/cloc

1 odpowiedź
0
Rozpoczynający temat
  1. download cloc.exe (for windows! any other app that was compiled  using MSYS2 may throw fatal error/Stack trace) and put in somewehere  
  2. example code
            $rawData = (shell_exec("powershell -ExecutionPolicy Bypass -Command \" ..\\tools\\cloc-1.94.exe ..\\resources\\js ..\\resources\\views  ..\\resources\\sass ..\\app ..\\routes ..\\config  | select-string 'SUM' | ForEach-Object { -split \$_ } \""));
            
            $splittedData = preg_split('/\r\n|\r|\n/', $rawData);
    
            $totalFiles = $splittedData[1];
            $totalLines = $splittedData[4];

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: