sanitized user names are available now.
authorFred Hamster <fred@gruntose.com>
Mon, 16 Dec 2024 20:27:12 +0000 (15:27 -0500)
committerFred Hamster <fred@gruntose.com>
Mon, 16 Dec 2024 20:27:12 +0000 (15:27 -0500)
scripts/core/variables.sh

index e66a3acaa4665ec23815006214f24b0b7a08ece8..b0bc95a6564f9fbc8400d32768e426cf53927dd4 100644 (file)
@@ -38,7 +38,11 @@ return 0
          echo "$1" | sed -e 's/\\/\//g' | sed -e 's/\([a-zA-Z]\):\/\(.*\)/\/cygdrive\/\1\/\2/'
   }
 
-
+  # a handy helper method that turns a potentially gross USER variable into
+  # a nice clean one (by removing email domains).
+  function sanitized_username() {
+    echo $USER | sed -e 's/@[a-zA-Z0-9_.]*//'
+  }
 
 ##############