Skip to content

Commit 98c2c9c

Browse files
daquexiangramalingamjcwchen
authored
Fix protoc gen mypy wrapper (onnx#3221)
* Fix wrong directory in wrappers Signed-off-by: daquexian <[email protected]> * Add generated file to .gitignore Signed-off-by: daquexian <[email protected]> Co-authored-by: G. Ramalingam <[email protected]> Co-authored-by: Chun-Wei Chen <[email protected]>
1 parent ec1a45a commit 98c2c9c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ compile_commands.json
8080
# generated files
8181
onnx/version.py
8282
compile_commands.json
83+
tools/protoc-gen-mypy.sh
8384

8485
# test generated files
8586
.cache

tools/protoc-gen-mypy.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
:: SPDX-License-Identifier: Apache-2.0
22

33
@echo off
4-
python -u %0\..\protoc-gen-mypy.py
4+
python -u %~dp0\protoc-gen-mypy.py

tools/protoc-gen-mypy.sh.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/bash
2+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
23
# use PYTHON_EXECUTABLE from CMake to get the right python to execute
3-
@PYTHON_EXECUTABLE@ -u "$PWD"/../tools/protoc-gen-mypy.py
4+
@PYTHON_EXECUTABLE@ -u "$DIR"/protoc-gen-mypy.py

0 commit comments

Comments
 (0)