fix: --reset no longer requires local Slack export path
test_reset_only_writes failed in CI (no ~/Downloads export) while passing on a laptop that has the Levkin export. Skip SlackExport load when --reset returns early.
This commit is contained in:
@@ -355,10 +355,6 @@ def main() -> int:
|
||||
if not arg.startswith("-") and Path(arg).expanduser().is_dir():
|
||||
export_path = Path(arg).expanduser().resolve()
|
||||
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
from slack_export import SlackExport
|
||||
|
||||
export = SlackExport(export_path)
|
||||
manifest: dict = {"channels": {}, "users": {}}
|
||||
if MANIFEST_PATH.is_file():
|
||||
manifest = json.loads(MANIFEST_PATH.read_text(encoding="utf-8"))
|
||||
@@ -377,6 +373,10 @@ def main() -> int:
|
||||
)
|
||||
return 0
|
||||
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
from slack_export import SlackExport
|
||||
|
||||
export = SlackExport(export_path)
|
||||
channels = manifest.setdefault("channels", {})
|
||||
stats: dict[str, int] = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user