Commit 466f7d9 1 parent dd0928e commit 466f7d9 Copy full SHA for 466f7d9
File tree 3 files changed +19
-4
lines changed
3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 1
1
* .sh text eol =lf
2
2
parameters.txt text eol =lf
3
3
protoc-gen-dump text eol =lf
4
+ protoc-gen-ts_proto text eol =lf
Original file line number Diff line number Diff line change 2
2
PROJECT_ROOT=$( realpath $( dirname " $BASH_SOURCE " ) )
3
3
PROJECT_ROOT_DOCKER=" //ts-proto" # double slash to support git bash on windows
4
4
5
- # Alias docker-compose to make it usable from anywhere
5
+ # Alias docker-compose to make it usable from anywhere.
6
6
function _docker-compose() { docker-compose -f $PROJECT_ROOT /docker-compose.yml " $@ " ; }
7
7
8
- function protoc() { _docker-compose run --rm protoc " $@ " ; }
9
- function protoc-sh() { _docker-compose run --rm --entrypoint sh -- protoc " $@ " ; }
8
+ # Dockerized version of protoc.
9
+ function protoc() { _docker-compose run --rm -w //host --entrypoint protoc -- protoc " $@ " ; }
10
+
11
+ # Open a shell in the dockerized version of protoc, useful for debugging.
12
+ function protoc-sh() { _docker-compose run --rm -w //host -- protoc " $@ " ; }
13
+
14
+ # Rebuild the docker image.
10
15
function protoc-build() { _docker-compose build protoc; }
11
- function ts-protoc { protoc --plugin=$PROJECT_ROOT_DOCKER /protoc-gen-ts_proto " $@ " ; }
16
+
17
+ # Run protoc with the plugin path pre-set.
18
+ function ts-protoc {
19
+ if [ ! -d " $PROJECT_ROOT /build" ]; then
20
+ echo " Run 'yarn build' first"
21
+ return 1
22
+ fi
23
+ protoc --plugin=$PROJECT_ROOT_DOCKER /protoc-gen-ts_proto " $@ " ;
24
+ }
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ services:
6
6
dockerfile : " protoc.Dockerfile"
7
7
volumes :
8
8
- " .:/ts-proto"
9
+ - " ${PWD:-.}:/host"
You can’t perform that action at this time.
0 commit comments