Skip to content

Instantly share code, notes, and snippets.

@default-writer
Last active March 6, 2017 16:12
Show Gist options
  • Save default-writer/722d63333efea0ec3c7cf8b20e33524d to your computer and use it in GitHub Desktop.
Save default-writer/722d63333efea0ec3c7cf8b20e33524d 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 -g') do @(
if "%%j"=="%%l" @(
@echo %%i %%j
) else @(
if "%%i"=="All" @(
@echo %%i: %%j - %%l
@goto:eof
) else @(
@set /a count += 1 > nul
@echo %%i: %%j - %%l >> %%i.ncu
@echo updating %%i: %%j %> %%l
@echo running npm install -g %%i
@npm install -g %%i
@npm update -g %%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