From 32f26a37e7eb8903f6bf6d6a29ad0b8da62eeff7 Mon Sep 17 00:00:00 2001 From: Doron Cohen Date: Sun, 13 Dec 2020 21:07:11 +0200 Subject: [PATCH] fix: remove init var check (#70) --- cmd/init.go | 11 ++++------- internal/utils/text.go | 14 -------------- 2 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 internal/utils/text.go diff --git a/cmd/init.go b/cmd/init.go index a3a2adb..29dcbd6 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -22,14 +22,11 @@ var initCmd = &cobra.Command{ aliasFilePath, err := utils.GetAliasFile() tui.FatalIfError("Failed to get alias file path", err) - tui.Print(`if [[ "$ANTIDOT_INIT" != "1" ]]; then -%s - source %s - source %s + tui.Print(`%s - export ANTIDOT_INIT=1 -fi`, - utils.IndentLines(utils.XdgVarsExport()), +source %s +source %s`, + utils.XdgVarsExport(), envFilePath, aliasFilePath, ) diff --git a/internal/utils/text.go b/internal/utils/text.go deleted file mode 100644 index 99e8c42..0000000 --- a/internal/utils/text.go +++ /dev/null @@ -1,14 +0,0 @@ -package utils - -import ( - "fmt" - "strings" -) - -func IndentLines(lines string) string { - var builder strings.Builder - for _, line := range strings.Split(lines, "\n") { - builder.WriteString(fmt.Sprintf(" %s\n", line)) - } - return builder.String() -}