Skip to content

Commit

Permalink
refactor: cleanup functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
noahzeisberg committed Jan 21, 2024
1 parent 5871040 commit 6ab91b9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ func main() {
input := Input(color.Gray + "┌─[" + color.Blue + username + color.Gray + "@" + color.Reset + device + color.Gray + "]─(" + color.Reset + "\U000F024B" + " " + currentDir + color.Gray + ")\n" + color.Gray + "└─> " + color.Reset)
if input != "" {
Print()
command, args := ParseCommand(input)
split := strings.Split(input, " ")
command := split[0]
args := utils.RemoveElement(split, 0)
RunCommand(command, args)
}
if semver.Compare(version, newestRelease.GetTagName()) == -1 {
Expand All @@ -83,13 +85,6 @@ func main() {
}
}

func ParseCommand(input string) (string, []string) {
split := strings.Split(input, " ")
command := split[0]
args := utils.RemoveElement(split, 0)
return command, args
}

func RunCommand(command string, args []string) {
commandFound := false
for _, cmd := range commands {
Expand Down

0 comments on commit 6ab91b9

Please sign in to comment.