🚧 Get files
This commit is contained in:
		
					parent
					
						
							
								4d49d9d57c
							
						
					
				
			
			
				commit
				
					
						3ae78a6704
					
				
			
		
					 2 changed files with 15 additions and 10 deletions
				
			
		
							
								
								
									
										12
									
								
								cmd/root.go
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								cmd/root.go
									
										
									
									
									
								
							|  | @ -7,7 +7,7 @@ import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"os" | 	"os" | ||||||
| 
 | 
 | ||||||
| 	"codeberg.org/danjones000/strip-beats/config" | 	"codeberg.org/danjones000/strip-beats/files" | ||||||
| 	"github.com/spf13/cobra" | 	"github.com/spf13/cobra" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -15,18 +15,10 @@ import ( | ||||||
| var rootCmd = &cobra.Command{ | var rootCmd = &cobra.Command{ | ||||||
| 	Use:   "strip-beats", | 	Use:   "strip-beats", | ||||||
| 	Short: "A brief description of your application", | 	Short: "A brief description of your application", | ||||||
| 	/* |  | ||||||
| 		Long: `A longer description that spans multiple lines and likely contains |  | ||||||
| 	examples and usage of using your application. For example: |  | ||||||
| 
 |  | ||||||
| 	Cobra is a CLI library for Go that empowers applications. |  | ||||||
| 	This application is a tool to generate the needed files |  | ||||||
| 	to quickly create a Cobra application.`, |  | ||||||
| 	*/ |  | ||||||
| 	// Uncomment the following line if your bare application | 	// Uncomment the following line if your bare application | ||||||
| 	// has an action associated with it: | 	// has an action associated with it: | ||||||
| 	Run: func(cmd *cobra.Command, args []string) { | 	Run: func(cmd *cobra.Command, args []string) { | ||||||
| 		fmt.Println(config.GetConfig()) | 		fmt.Println(files.GetCandidates()) | ||||||
| 	}, | 	}, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										13
									
								
								files/source.go
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								files/source.go
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | ||||||
|  | package files | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"codeberg.org/danjones000/strip-beats/config" | ||||||
|  | 	"path/filepath" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | func GetCandidates() []string { | ||||||
|  | 	source := config.GetConfig().Source | ||||||
|  | 	ret, _ := filepath.Glob(filepath.Join(source, "*/*")) | ||||||
|  | 
 | ||||||
|  | 	return ret | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue