]> git.ralfj.de Git - bubblebox.git/blobdiff - bubblebox.py
add symlink helper
[bubblebox.git] / bubblebox.py
index d7c6cb0b326d4f73212573a91bb06061b4e40d97..a3c2d74db32ccc98301177bcbc0ea97bc7d30178 100644 (file)
@@ -144,7 +144,10 @@ def host_access(dirs):
             path = path.replace("//", "/")
             path = path.removesuffix("/.")
             # glob expansion
             path = path.replace("//", "/")
             path = path.removesuffix("/.")
             # glob expansion
-            yield from glob.glob(path)
+            globbed = glob.glob(path)
+            if len(globbed) == 0:
+                raise Exception(f"Path does not exist: {path}")
+            yield from globbed
     def recursive_host_access(root, dirs, out):
         for names, desc in dirs.items():
             for path in expand(root, names):
     def recursive_host_access(root, dirs, out):
         for names, desc in dirs.items():
             for path in expand(root, names):
@@ -162,5 +165,8 @@ def host_access(dirs):
 def home_access(dirs):
     return host_access({ HOME: dirs })
 
 def home_access(dirs):
     return host_access({ HOME: dirs })
 
+def home_symlink(dest, link):
+    return bwrap_flags("--symlink", HOME + dest, HOME + link)
+
 # Profile the profiles when importing bubblebox.
 import profiles
 # Profile the profiles when importing bubblebox.
 import profiles