Skip to content

Commit

Permalink
added functionality back
Browse files Browse the repository at this point in the history
  • Loading branch information
shtayeb committed Nov 15, 2023
1 parent e0b541e commit aba7ce5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ archives:
- id: nix
builds: [macos, linux]
<<: &archive_defaults
name_template: "name_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
name_template: "organizer_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: true
format: tar.gz
files:
Expand Down
34 changes: 17 additions & 17 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@ package cmd

import (
"fmt"
"log"
"os"

"github.com/shtayeb/go-organizer/cmd/organizers"
"github.com/spf13/cobra"
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "organizer",
Version: "0.1.0",
Version: "0.1.1",
Short: "A CLI app to organize your files into folders according to their extensions.",
Run: func(cmd *cobra.Command, args []string) {

fmt.Println("Hello World!")
path, _ := os.Getwd()

// path, _ := os.Getwd()
// Get list of files in the working directory
entries, err := os.ReadDir(path)

// // Get list of files in the working directory
// entries, err := os.ReadDir(path)
if err != nil {
log.Fatal(err)
}

// if err != nil {
// log.Fatal(err)
// }
for _, entry := range entries {
if entry.IsDir() {
continue
}

// for _, entry := range entries {
// if entry.IsDir() {
// continue
// }
fullFileName := entry.Name()
organizers.OrganizeFiles(path, fullFileName)

// fullFileName := entry.Name()
// organizers.OrganizeFiles(path, fullFileName)
}

// }

// fmt.Printf("Program run !")
fmt.Printf("Organizer Finished Execution !")
},
}

Expand Down

0 comments on commit aba7ce5

Please sign in to comment.