Skip to content

Instantly share code, notes, and snippets.

@patrickgalbraith
Created January 28, 2019 23:38
Show Gist options
  • Save patrickgalbraith/a2ca995cf3f21a116398f82a653f9e14 to your computer and use it in GitHub Desktop.
Save patrickgalbraith/a2ca995cf3f21a116398f82a653f9e14 to your computer and use it in GitHub Desktop.
Extract package.json version in Windows Batch (.bat) file
@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%
@jginternational
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment