Fix relative path to .gitignore and other minor changes.

R=kjellander@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1624005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4195 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2013-06-07 15:43:04 +00:00
parent 3ba883f0fc
commit 6367fe885a

View File

@ -20,15 +20,18 @@ import sys
MODIFY_STRING = '# The following added by %s\n'
def main(argv):
if not argv[1]:
# Special case; do nothing.
return 0
modify_string = (MODIFY_STRING % argv[0])
gitignore_file = os.path.dirname(argv[0]) + '/../.gitignore'
modify_string = MODIFY_STRING % argv[0]
gitignore_file = os.path.dirname(argv[0]) + '/../../.gitignore'
lines = open(gitignore_file, 'r').readlines()
for i, line in enumerate(lines):
# Look for modify_string in the file to ensure we don't append the extra
# patterns more than once.
if line == modify_string:
lines = lines[:i]
break