decided to yeet my entire cosmic config into a home manager module and needed a script to do it. Kinda a qd solution but it works
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

clean up a bit and...

+10 -22
+1
.gitignore
··· 2 2 *.ez 3 3 /build 4 4 erl_crash.dump 5 + output.nix
+9 -9
src/convert_cosmic.gleam
··· 14 14 "/home/mar/.config/cosmic/" <> current_module <> "/v1/" 15 15 let current_module_path_xdg_config_relative = 16 16 "cosmic/" <> current_module <> "/v1/" 17 - // io.println( 18 - // "Current module:\t" 19 - // <> current_module 20 - // <> " (" 21 - // <> current_module_path_xdg_config_relative 22 - // <> ")", 23 - // ) 17 + io.println( 18 + "Current module:\t" 19 + <> current_module 20 + <> " (" 21 + <> current_module_path_xdg_config_relative 22 + <> ")", 23 + ) 24 24 use items <- result.try(simplifile.read_directory({ current_module_path })) 25 25 26 26 list.map(items, fn(item) { ··· 39 39 True -> "''\n" <> file_contents <> "\n''" 40 40 False -> "\"" <> file_contents |> string.replace("\"", "\\\"") <> "\"" 41 41 } 42 - // Printie 42 + // Printie? 43 43 let oui = file_entry <> ".text = " <> qouted_file <> ";" 44 - io.println(oui) 44 + // io.println(oui) 45 45 let assert Ok(_) = simplifile.append("./output.nix", oui <> "\n\n") 46 46 }) 47 47 })
-13
test/convert_cosmic_test.gleam
··· 1 - import gleeunit 2 - 3 - pub fn main() -> Nil { 4 - gleeunit.main() 5 - } 6 - 7 - // gleeunit test functions end in `_test` 8 - pub fn hello_world_test() { 9 - let name = "Joe" 10 - let greeting = "Hello, " <> name <> "!" 11 - 12 - assert greeting == "Hello, Joe!" 13 - }