Code polish
This commit is contained in:
3
main.go
3
main.go
@@ -200,6 +200,7 @@ func setupGit() error {
|
|||||||
}
|
}
|
||||||
logger.Printf("Current working directory obtained: %s", cwd)
|
logger.Printf("Current working directory obtained: %s", cwd)
|
||||||
|
|
||||||
|
logger.Printf("Attempting to open git repository at %s", cwd)
|
||||||
repo, err = git.PlainOpen(cwd)
|
repo, err = git.PlainOpen(cwd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Printf("No existing git repository found at %s, attempting to initialize a new git repository.", cwd)
|
logger.Printf("No existing git repository found at %s, attempting to initialize a new git repository.", cwd)
|
||||||
@@ -212,6 +213,7 @@ func setupGit() error {
|
|||||||
logger.Printf("Successfully opened existing git repository at %s", cwd)
|
logger.Printf("Successfully opened existing git repository at %s", cwd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Printf("Attempting to obtain worktree for repository at %s", cwd)
|
||||||
worktree, err = repo.Worktree()
|
worktree, err = repo.Worktree()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to obtain worktree for repository at %s: %w", cwd, err)
|
return fmt.Errorf("failed to obtain worktree for repository at %s: %w", cwd, err)
|
||||||
@@ -241,6 +243,7 @@ func expandFilePatterns(patterns []string) ([]string, error) {
|
|||||||
|
|
||||||
func cleanupGitFiles(files []string) error {
|
func cleanupGitFiles(files []string) error {
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
|
logger.Printf("Checking file: %s", file)
|
||||||
status, err := worktree.Status()
|
status, err := worktree.Status()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error getting worktree status: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error getting worktree status: %v\n", err)
|
||||||
|
@@ -17,6 +17,7 @@ echo "Tag: $TAG"
|
|||||||
|
|
||||||
echo "Building the thing..."
|
echo "Building the thing..."
|
||||||
go build -o chef.exe .
|
go build -o chef.exe .
|
||||||
|
go install .
|
||||||
|
|
||||||
echo "Creating a release..."
|
echo "Creating a release..."
|
||||||
TOKEN="$GITEA_API_KEY"
|
TOKEN="$GITEA_API_KEY"
|
||||||
|
Reference in New Issue
Block a user