Skip to content

Instantly share code, notes, and snippets.

@sandeeplearner
Last active August 17, 2020 21:23
Show Gist options
  • Save sandeeplearner/0e5548ebbc1ba145523eecc7017d1c1d to your computer and use it in GitHub Desktop.
Save sandeeplearner/0e5548ebbc1ba145523eecc7017d1c1d to your computer and use it in GitHub Desktop.
Delete and Generate .swift files from proto files
#!/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