diff options
-rw-r--r-- | fietsboek/updater/__init__.py | 4 | ||||
-rw-r--r-- | fietsboek/updater/cli.py (renamed from fietsboek/updater/__main__.py) | 0 | ||||
-rw-r--r-- | setup.py | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/fietsboek/updater/__init__.py b/fietsboek/updater/__init__.py index 038fcd5..724defa 100644 --- a/fietsboek/updater/__init__.py +++ b/fietsboek/updater/__init__.py @@ -244,7 +244,7 @@ class Updater: ) filename = f"upd_{revision_id}.py" - filepath = Path(__file__).parent / filename + filepath = Path(__file__).parent / "scripts" / filename LOGGER.info("Writing new revision (%s) to %r", revision_id, filepath) with open(filepath, "x", encoding="utf-8") as fobj: fobj.write(revision) @@ -346,7 +346,7 @@ def _filename_to_modname(name): def _load_update_scripts(): """Loads all available import scripts.""" - files = importlib_resources.files(__name__) + files = importlib_resources.files(__name__) / "scripts" return [ UpdateScript(file.read_text(), _filename_to_modname(file.name)) for file in files.iterdir() diff --git a/fietsboek/updater/__main__.py b/fietsboek/updater/cli.py index 38297d7..38297d7 100644 --- a/fietsboek/updater/__main__.py +++ b/fietsboek/updater/cli.py @@ -63,6 +63,7 @@ setup( ], 'console_scripts': [ 'fietsctl=fietsboek.scripts.fietsctl:main', + 'fietsupdate=fietsboek.updater.cli:cli', ], }, ) |