Skip to content

Commit

Permalink
Check for existing target folder in build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-hen committed Feb 15, 2021
1 parent f8e46bf commit 0b111c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deploy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from subprocess import run
from pathlib import Path
from shutil import move
from shutil import rmtree

root = Path(__file__).absolute().parent.parent

Expand All @@ -14,4 +14,8 @@
process = run('flit build --format wheel', cwd=root, shell=True)
if process.returncode:
raise RuntimeError('Error while building wheel.')
move(root/'dist', root/'deploy'/'dist')
source = root/'dist'
target = root/'deploy'/'dist'
if target.exists():
rmtree(target)
source.rename(target)

0 comments on commit 0b111c2

Please sign in to comment.