Verified Commit 344f3d72 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

add exception handling if whitelist does not exist

parent 0dd6d30e
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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment