File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66
7- "gettrackers/internal/fetch"
87 "gettrackers/internal/filter"
8+ "gettrackers/internal/paths"
99
1010 "github.com/spf13/cobra"
1111)
@@ -35,15 +35,22 @@ func init() {
3535}
3636
3737func runShowSources (cmd * cobra.Command , args []string ) error {
38- urls , err := fetch .LoadCache ()
38+ // Read and output the raw cache file content (unfiltered)
39+ cacheFile , err := paths .GetCacheFile ()
3940 if err != nil {
40- return fmt .Errorf ("failed to load cache: %w" , err )
41+ return fmt .Errorf ("failed to get cache file path : %w" , err )
4142 }
4243
43- for _ , url := range urls {
44- fmt .Println (url )
44+ data , err := os .ReadFile (cacheFile )
45+ if err != nil {
46+ if os .IsNotExist (err ) {
47+ return fmt .Errorf ("cache file does not exist" )
48+ }
49+ return fmt .Errorf ("failed to read cache file: %w" , err )
4550 }
4651
52+ // Output the raw cache file content
53+ fmt .Print (string (data ))
4754 return nil
4855}
4956
Original file line number Diff line number Diff line change @@ -11,4 +11,3 @@ func main() {
1111 os .Exit (1 )
1212 }
1313}
14-
You can’t perform that action at this time.
0 commit comments