Skip to content

Commit

Permalink
refactor: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
iton0 committed Dec 31, 2024
1 parent 7c89c7f commit 8063fbb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
4 changes: 1 addition & 3 deletions cmd/config/root.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package config

import (
"github.com/spf13/cobra"
)
import "github.com/spf13/cobra"

// RootCmd is the root config subcommand that will be added to the root HkUp
// command.
Expand Down
4 changes: 1 addition & 3 deletions cmd/template/root.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package template

import (
"github.com/spf13/cobra"
)
import "github.com/spf13/cobra"

// RootCmd is the root template subcommand that will be added to the root HkUp
// command.
Expand Down
4 changes: 2 additions & 2 deletions internal/logic/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ func getHookTemplates() []string {
// getCwdHooks returns the hooks in the current working directory.
// If no hooks are found, returns a empty string slice.
func getCwdHooks() []string {
out := []string{}

files, err := os.ReadDir(util.HkupDirName)
if err != nil {
return nil
}

out := []string{}

for _, file := range files {
out = append(out, file.Name())
}
Expand Down
6 changes: 2 additions & 4 deletions internal/util/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import (
"strings"
)

const (
// HkupDirName defines HkUp directory name within current working directory.
HkupDirName = ".hkup"
)
// HkupDirName defines HkUp directory name within current working directory.
const HkupDirName = ".hkup"

// CreateDirectory makes a new directory at the specified path.
// Returns an error if the operation fails.
Expand Down
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Package main initializes Cobra
package main

import (
"github.com/iton0/hkup-cli/cmd"
)
import "github.com/iton0/hkup-cli/cmd"

func main() {
cmd.Execute()
Expand Down

0 comments on commit 8063fbb

Please sign in to comment.