aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-06-20 11:32:35 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-06-20 11:32:35 -0700
commitb7dde0b3a5710b8bf09bdf065bcc78dd0e5cce38 (patch)
tree9db56d43839a29f82a6a724ed7ba95b084df9c1e
parent955516759cfed29122439938632964fed4f8a347 (diff)
feat: added file to update directory tree
-rwxr-xr-xbin/updatedirs17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/updatedirs b/bin/updatedirs
new file mode 100755
index 0000000..bb646e0
--- /dev/null
+++ b/bin/updatedirs
@@ -0,0 +1,17 @@
+#!/bin/python
+
+import os
+
+ROOT = "/home/nolln/root"
+SRC = "sys"
+BUILD = "build"
+TEST = "test"
+IGNORED = ["build", "include", "lib", "bin", ".git", "vendor", "obj", "dep", ".generated"]
+
+if __name__ == "__main__":
+ for root, dirs, _ in os.walk(f"{ROOT}/{SRC}"):
+ dirs[:] = [d for d in dirs if d not in IGNORED]
+ for newroot in [BUILD, TEST]:
+ blddir = f"{ROOT}/{newroot}/{root[len(ROOT)+len(SRC)+2:]}"
+ if not os.path.exists(blddir):
+ os.mkdir(blddir)