Commit cdbf27ac authored by Peter Sutton's avatar Peter Sutton
Browse files

Fix upload

parent 1e11765e
......@@ -4,6 +4,7 @@ import json
import os
import shutil
import subprocess
from argparse import ArgumentParser
from contextlib import suppress
from dataclasses import dataclass
from getpass import getpass
......@@ -84,7 +85,6 @@ def upload(user: str, password: str) -> None:
except error_perm as e:
if not e.args[0].startswith('550'):
raise
ftp.rmd(name)
it = os.walk(DIST_PATH, topdown=True)
for dirpath, dirnames, filenames in it:
dirrelpath = Path(dirpath).relative_to(DIST_PATH)
......@@ -105,6 +105,10 @@ def upload(user: str, password: str) -> None:
def main() -> None:
parser = ArgumentParser()
parser.add_argument('--no-build', action='store_false', default=True,
dest='build')
args = parser.parse_args()
credentials = load_credentials()
write = False
if credentials.user is None:
......@@ -113,7 +117,8 @@ def main() -> None:
if credentials.password is None:
credentials.password = ask_password()
write = True
clean_build()
if args.build:
clean_build()
upload(credentials.user, credentials.password)
if write:
data = {
......
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