From b6aa52dc5677b798ae58662066e195de7122f741 Mon Sep 17 00:00:00 2001 From: rahulv4667 <4667rahul@gmail.com> Date: Wed, 2 Jun 2021 09:12:36 +0530 Subject: [PATCH] added batch script for windows --- bin/protoc-gen-ts.cmd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bin/protoc-gen-ts.cmd diff --git a/bin/protoc-gen-ts.cmd b/bin/protoc-gen-ts.cmd new file mode 100644 index 00000000..e9f704f2 --- /dev/null +++ b/bin/protoc-gen-ts.cmd @@ -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 \ No newline at end of file