mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-26 05:04:34 +00:00
Use proper users home even when in sudo
This commit is contained in:
parent
ede00ca602
commit
50f1ff3a55
5
sync.py
5
sync.py
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import hashlib
|
||||
import sys
|
||||
from collections.abc import Iterable, Iterator
|
||||
|
@ -14,10 +15,10 @@ except ImportError:
|
|||
print("rich not found (`pip install rich`), falling back to no colors", file=sys.stderr)
|
||||
rich = None
|
||||
|
||||
DOTHOMEDIR = Path("./home")
|
||||
HOMEDIR = Path("~")
|
||||
DOTROOTDIR = Path("./root")
|
||||
ROOTDIR = Path("/")
|
||||
DOTHOMEDIR = Path("./home")
|
||||
HOMEDIR = Path(f"~{os.environ.get('SUDO_USER', os.getlogin())}") # Make sure we use correct home even in sudo
|
||||
|
||||
|
||||
class DiffStatus(Enum):
|
||||
|
|
Loading…
Reference in a new issue