mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-16 06:31:24 +01:00
Update doc comments
This commit is contained in:
parent
5808a868f1
commit
33aa9228e2
1 changed files with 4 additions and 3 deletions
|
|
@ -1,8 +1,8 @@
|
|||
open Core;
|
||||
module Unix = Core_unix;
|
||||
|
||||
/*** Run a process [name] with args [args], returning (exit_code, stdout text) */
|
||||
let run_process = (name, args) => {
|
||||
/*** Run a process [name] with args [args], returning (exit_code, stdout text) */
|
||||
let stdout_chan =
|
||||
Unix.open_process_in(name ++ " " ++ (args |> String.concat(~sep=" ")));
|
||||
let stdout_content = stdout_chan |> In_channel.input_all;
|
||||
|
|
@ -10,6 +10,7 @@ let run_process = (name, args) => {
|
|||
(exit_code, stdout_content);
|
||||
};
|
||||
|
||||
/*** Run nix with some fixed arguments, appending a user provided set of arguments. */
|
||||
let nix = args =>
|
||||
run_process(
|
||||
"nix",
|
||||
|
|
@ -17,7 +18,7 @@ let nix = args =>
|
|||
);
|
||||
|
||||
let hash_files = filenames => {
|
||||
/*** Hash all entries in [filenames]
|
||||
/*** Hash all entries in [filenames] which represent existing files.
|
||||
Returns Some(hex-string) or None if no filenames are found.
|
||||
*/
|
||||
let ctx = Sha1.init();
|
||||
|
|
@ -27,7 +28,6 @@ let hash_files = filenames => {
|
|||
switch (Sys_unix.file_exists(f)) {
|
||||
| `Yes => true
|
||||
| _ =>
|
||||
// let fullpth = Filename_unix.realpath(f);
|
||||
Printf.eprintf(
|
||||
"Cannot find file %s (cwd: %s)\n",
|
||||
f,
|
||||
|
|
@ -53,6 +53,7 @@ let hash_files = filenames => {
|
|||
};
|
||||
|
||||
let rec rmrf = path => {
|
||||
/*** Remove [path] recursively */
|
||||
switch (Unix.lstat(path).st_kind) {
|
||||
| exception (Unix.Unix_error(_, _, _)) => ()
|
||||
| S_REG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue