From 52cd4f82fbb4fbc6660914aaebd0946591001692 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 23 Dec 2021 21:16:24 -0500 Subject: refactor(wpcarro): Remove DESKTOP, LAPTOP env-var deps Looks like symlinkManager is the only code depending on these variables, and the dependency seems obsolete. Change-Id: I7abe3c404ec9141f28e3eacd88388fb96ec2de88 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4548 Reviewed-by: wpcarro Autosubmit: wpcarro Tested-by: BuildkiteCI --- users/wpcarro/.envrc | 2 -- users/wpcarro/tools/symlinkManager/main.go | 25 ++----------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/users/wpcarro/.envrc b/users/wpcarro/.envrc index efa3a98b3dca..196758a932f0 100644 --- a/users/wpcarro/.envrc +++ b/users/wpcarro/.envrc @@ -1,4 +1,2 @@ source_up -export DESKTOP="zeno.lon.corp.google.com"; -export LAPTOP="seneca"; export WPCARRO="$REPO_ROOT/users/wpcarro" diff --git a/users/wpcarro/tools/symlinkManager/main.go b/users/wpcarro/tools/symlinkManager/main.go index e682867fb850..d99c7cb863ce 100644 --- a/users/wpcarro/tools/symlinkManager/main.go +++ b/users/wpcarro/tools/symlinkManager/main.go @@ -11,16 +11,10 @@ import ( "utils" ) -var hostnames = map[string]string{ - os.Getenv("DESKTOP"): "desktop", - os.Getenv("LAPTOP"): "work_laptop", -} - func main() { audit := flag.Bool("audit", false, "Output all symlinks that would be deleted. This is the default behavior. This option is mutually exclusive with the --seriously option.") seriously := flag.Bool("seriously", false, "Actually delete the symlinks. This option is mutually exclusive with the --audit option.") repoName := flag.String("repo-name", "briefcase", "The name of the repository.") - deviceOnly := flag.Bool("device-only", false, "Only output the device-specific dotfiles.") flag.Parse() if !*audit && !*seriously { @@ -39,23 +33,8 @@ func main() { dest, err := os.Readlink(path) utils.FailOn(err) - var predicate func(string) bool - - if *deviceOnly { - predicate = func(dest string) bool { - var hostname string - hostname, err = os.Hostname() - utils.FailOn(err) - seeking, ok := hostnames[hostname] - if !ok { - log.Fatal(fmt.Sprintf("Hostname \"%s\" not supported in the hostnames map.", hostname)) - } - return strings.Contains(dest, *repoName) && strings.Contains(dest, seeking) - } - } else { - predicate = func(dest string) bool { - return strings.Contains(dest, *repoName) - } + predicate := func(dest string) bool { + return strings.Contains(dest, *repoName) } if predicate(dest) { -- cgit 1.4.1