Created
January 31, 2017 17:08
-
-
Save mhowlett/fb47bf6d6dd626f6bf76da8283d81642 to your computer and use it in GitHub Desktop.
script to comment / uncomment net451 framework in project.json
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/local/bin/python | |
with open ("/git/confluent-kafka-dotnet/src/Confluent.Kafka/project.json", "r") as myfile: | |
data = myfile.readlines() | |
out = [] | |
for line in data: | |
line2 = line[:-1] | |
if "net451" in line2: | |
if line2[0:2] == "/*": | |
line2 = line2[2:-2] | |
else: | |
line2 = "/*" + line2 + "*/" | |
out.append(line2) | |
with open ("/git/confluent-kafka-dotnet/src/Confluent.Kafka/project.json", "w") as myfile: | |
for line in out: | |
myfile.write(line + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment