Skip to content
Snippets Groups Projects
Verified Commit 344f3d72 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

add exception handling if whitelist does not exist

parent 0dd6d30e
No related branches found
No related tags found
No related merge requests found
import os, re
from os import path
from natsort import natsorted
from pathlib import Path
def line_prepender(filename, line):
with open(filename, 'r+') as f:
......@@ -236,9 +237,10 @@ print("\n > New index generated and saved in " + indexFile)
# write link whitelist out
whiteListFile = ".ci/whitelist.txt"
with open(whiteListFile, 'r') as file :
for line in file:
whiteList += line
if Path(whiteListFile).exists():
with open(whiteListFile, 'r') as file :
for line in file:
whiteList += line
with open(whiteListFile, 'w') as file:
file.write(whiteList)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment