-
-
Save sandeeplearner/0e5548ebbc1ba145523eecc7017d1c1d to your computer and use it in GitHub Desktop.
Delete and Generate .swift files from proto files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def delete_proto_files | |
if File.directory?("SwiftProtoFiles") | |
FileUtils.remove_dir("SwiftProtoFiles") | |
puts "SwiftProtoFiles directory deleted" | |
Dir.mkdir("SwiftProtoFiles") | |
else | |
Dir.mkdir("SwiftProtoFiles") | |
end | |
end | |
def run_protoc | |
Dir.chdir("ProtoRepo") do | |
system("protoc --swift_out=../SwiftProtoFiles/ *.proto") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment