Skip to content

Commit

Permalink
added batch script for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulv4667 committed Jun 2, 2021
1 parent e99f990 commit b6aa52d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/protoc-gen-ts.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

@REM check if package is installed locally.
for /f %%i in ('npm root') do set install_path=%%i

@REM if not installed locally, set install path to global one
setlocal enabledelayedexpansion
if not exist !install_path!\protoc-gen-ts\ (
for /f %%i in ('npm root -g') do set install_path=%%i
)
endlocal & set install_path=%install_path%

@REM invoke the index.js
node %install_path%\protoc-gen-ts\src\index

0 comments on commit b6aa52d

Please sign in to comment.