fix: update access time on run/freeze

This commit is contained in:
Daylin Morgan 2023-06-01 09:56:51 -05:00
parent 3b74384bc6
commit 35bffaebad
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -50,7 +50,7 @@ from typing import (
from urllib.error import HTTPError from urllib.error import HTTPError
from urllib.request import urlopen from urllib.request import urlopen
__version__ = "23.5a4-23-gf0e18ac-dev" __version__ = "23.5a4-25-g3b74384-dev"
class Config: class Config:
@ -746,6 +746,9 @@ class ViVenv:
verbose=bool(os.getenv("VIV_VERBOSE")), verbose=bool(os.getenv("VIV_VERBOSE")),
) )
def touch(self) -> None:
self.meta.accessed = str(datetime.today())
def show(self) -> None: def show(self) -> None:
_id = ( _id = (
self.meta.id[:8] self.meta.id[:8]
@ -978,6 +981,9 @@ class Viv:
else: else:
echo("re-using existing vivenv") echo("re-using existing vivenv")
vivenv.touch()
vivenv.meta.write()
echo("see below for import statements\n") echo("see below for import statements\n")
if args.standalone: if args.standalone:
@ -1210,7 +1216,9 @@ class Viv:
else: else:
vivenv.create() vivenv.create()
vivenv.install_pkgs() vivenv.install_pkgs()
vivenv.meta.write()
vivenv.touch()
vivenv.meta.write()
sys.exit(subprocess.run([vivenv.path / "bin" / bin, *args.rest]).returncode) sys.exit(subprocess.run([vivenv.path / "bin" / bin, *args.rest]).returncode)