Skip to content

Instantly share code, notes, and snippets.

@mhowlett
Created January 31, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhowlett/fb47bf6d6dd626f6bf76da8283d81642 to your computer and use it in GitHub Desktop.
Save mhowlett/fb47bf6d6dd626f6bf76da8283d81642 to your computer and use it in GitHub Desktop.
script to comment / uncomment net451 framework in project.json
#!/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