diff options
| author | ยท๐๐ด๐๐๐ฉ๐ค | 2025-12-30 07:09:05 +0000 |
|---|---|---|
| committer | ยท๐๐ด๐๐๐ฉ๐ค | 2025-12-30 07:09:05 +0000 |
| commit | 245952748751460fc3d0a35b03419959ec2c99b4 (patch) | |
| tree | bc1c9ee5be8de5dfceaee241abe9c56c9f004ae9 | |
| parent | 7dec66ec52b559cc5cb80f899182b55440736834 (diff) | |
| download | nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.tar nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.tar.gz nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.tar.bz2 nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.tar.lz nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.tar.xz nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.tar.zst nixtaml-245952748751460fc3d0a35b03419959ec2c99b4.zip | |
ignore: onset
| -rw-r--r-- | lib/working_directory.ml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/working_directory.ml b/lib/working_directory.ml index 6ce98d5..fec8934 100644 --- a/lib/working_directory.ml +++ b/lib/working_directory.ml @@ -39,6 +39,10 @@ trim_trailing_whitespace = true insert_final_newline = unset |} +let root_ignore_content = + {|silo +|} + let set_up_editor_config ~dir ~content = let editor_config_file = Eio.Path.(dir / ".editorconfig") in Logs.info (fun m -> m "Writing new Nixtamal EditorConfig%a โฆ" pp_native_path editor_config_file); @@ -46,13 +50,21 @@ let set_up_editor_config ~dir ~content = Eio.Buf_write.with_flow flow @@ fun writer -> Eio.Buf_write.string writer content +let set_up_ignore ~dir ~content = + let ignore_file = Eio.Path.(dir / ".ignore") in + Logs.info (fun m -> m "Writing new Nixtamal ignore%a โฆ" pp_native_path ignore_file); + Eio.Path.with_open_out ~create: (`Or_truncate 0o644) ignore_file @@ fun flow -> + Eio.Buf_write.with_flow flow @@ fun writer -> + Eio.Buf_write.string writer content + let set_up_root () = let dir = get () in match Eio.Path.kind ~follow: true dir with | `Not_found -> Logs.info (fun m -> m "Making Nixtamal directory%a" pp_native_path dir); Eio.Path.mkdirs ~perm: 0o755 dir; - set_up_editor_config ~dir ~content: root_editor_config_content + set_up_editor_config ~dir ~content: root_editor_config_content; + set_up_ignore ~dir ~content: root_ignore_content | `Directory -> Logs.warn (fun m -> m "Nixtamal directory already exists%a" pp_native_path dir) | _ -> |
