Created
January 28, 2019 23:38
-
-
Save patrickgalbraith/a2ca995cf3f21a116398f82a653f9e14 to your computer and use it in GitHub Desktop.
Extract package.json version in Windows Batch (.bat) file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal EnableDelayedExpansion | |
set c=0 | |
set version="" | |
for /f "tokens=1,2 delims=:, " %%a in (' find ":" ^< "package.json" ') do ( | |
if "%%~a"=="version" ( | |
set version=%%~b | |
) | |
) | |
echo %version% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice