Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Commit

Permalink
🎨 don't read by line
Browse files Browse the repository at this point in the history
  • Loading branch information
stoeffel committed Oct 18, 2016
1 parent 9958a22 commit de188c2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions native_package_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,11 @@ def get_source_dirs(vendor_dir, package):

def replace_in_file(filePath, src, target):
""" find replace in a file """
lines = []
output = ""
with open(filePath) as infile:
for line in infile:
line = line.replace(src, target)
lines.append(line)
output = infile.read().replace(src, target)
with open(filePath, 'w') as outfile:
for line in lines:
outfile.write(line)
outfile.write(output)


def find_all_native_files(path):
Expand Down

0 comments on commit de188c2

Please sign in to comment.