Skip to content

Instantly share code, notes, and snippets.

@muath-ye
Created November 15, 2023 07:58
Show Gist options
  • Save muath-ye/13ddae22149d2f90d1239896cb104ec2 to your computer and use it in GitHub Desktop.
Save muath-ye/13ddae22149d2f90d1239896cb104ec2 to your computer and use it in GitHub Desktop.
Auto commit your files with dynamic add and commit files on "app\Http\Validators" path and name the commit relatively to "app\Http\Validators" without ".php" (last for characters) [note the loop starts from "\app\Http\Validators" path]
:: Auto commit your files with dynamic add and commit files on "app\Http\Validators" path and name the commit relatively to "app\Http\Validators" without ".php" (last for characters) [note the loop starts from "\app\Http\Validators" path]
@echo off
setlocal enabledelayedexpansion
for /R .\app\Http\Validators %%i in (*.*) do (
set "relativePath=%%i"
set "relativePath=!relativePath:*\app\Http\Validators\=!"
set "relativePath=!relativePath:~0,-4!"
git add "%%i" & git commit -m "chore: update !relativePath!"
)
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment