Skip to content

Instantly share code, notes, and snippets.

@default-writer
Last active March 6, 2017 16:11
Show Gist options
  • Save default-writer/8c6da298f4d04abce0c84e9273034df0 to your computer and use it in GitHub Desktop.
Save default-writer/8c6da298f4d04abce0c84e9273034df0 to your computer and use it in GitHub Desktop.
@setlocal ENABLEDELAYEDEXPANSION
@echo off
:loop
@set /a count = 0
@for /f "eol=! tokens=1,2,3,* delims= " %%i in ('ncu -u') do @(
@if "%%j"=="%%l" @(
echo %%i %%j
) else @(
@if "%%i"=="All" @(
@echo %%i: %%j - %%l
@goto:eof
) else @(
@if "%%i"=="Upgraded" @(
@set /a count += 1 > nul
) else @(
@if "%%i"=="Using" @(
@set /a count += 1 > nul
) else @(
@if "%%i"=="The" @(
@echo %%i %%j %%k %%l
@set /a count += 1 > nul
) else @(
@set /a count += 1 > nul
@echo %%i: %%j - %%l >> %%i.ncu
@echo updating %%i: %%j %> %%l
@echo running npm install %%i
@npm install %%i
@npm update %%i
)
)
)
)
)
)
@if "%count%"=="0" @(goto:eof)
goto loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment