From 39786aae2162c1a259651b80d2cd75f5bbb9d100 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 12 Jun 2023 13:20:00 -0500 Subject: [PATCH] feat: support a local script --- src/viv/viv.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index 1e63835..e8ddff4 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -50,7 +50,7 @@ from typing import ( from urllib.error import HTTPError from urllib.request import urlopen -__version__ = "23.5a5-26-g79ae1da-dev" +__version__ = "23.5a5-27-ge697488-dev" class Spinner: @@ -1322,7 +1322,12 @@ class Viv: "https://raw.githubusercontent.com/daylinmorgan/viv/script-runner/src/viv/viv.py" ) ) - script_text = fetch_script(script) + + if Path(script).is_file(): + script_text = Path(script).read_text() + else: + script_text = fetch_script(script) + viv_used = uses_viv(script_text) scriptpath.write_text(script_text)