From d6c484f321d2f622846c019d36b07874de35a309 Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Sun, 31 Oct 2021 14:29:42 -0700 Subject: [PATCH] reddit: ensure rexport isnt pointing to repo --- my/reddit/rexport.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/my/reddit/rexport.py b/my/reddit/rexport.py index ca2059d..cca3e35 100755 --- a/my/reddit/rexport.py +++ b/my/reddit/rexport.py @@ -5,6 +5,7 @@ REQUIRES = [ 'git+https://github.com/karlicoss/rexport', ] +from pathlib import Path from my.core.common import Paths from dataclasses import dataclass from typing import Any @@ -26,7 +27,8 @@ from my.core.cfg import make_config, Attrs # hmm, also nice thing about this is that migration is possible to test without the rest of the config? def migration(attrs: Attrs) -> Attrs: # new structure, take top-level config and extract 'rexport' class - if 'rexport' in attrs: + # previously, 'rexport' key could be location of the rexport repo on disk + if 'rexport' in attrs and not isinstance(attrs['rexport'], (str, Path)): ex: uconfig.rexport = attrs['rexport'] attrs['export_path'] = ex.export_path else: