mirror of
https://git.sr.ht/~bryan_bennett/flake_env
synced 2025-12-16 22:51: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;
|
open Core;
|
||||||
module Unix = Core_unix;
|
module Unix = Core_unix;
|
||||||
|
|
||||||
|
/*** Run a process [name] with args [args], returning (exit_code, stdout text) */
|
||||||
let run_process = (name, args) => {
|
let run_process = (name, args) => {
|
||||||
/*** Run a process [name] with args [args], returning (exit_code, stdout text) */
|
|
||||||
let stdout_chan =
|
let stdout_chan =
|
||||||
Unix.open_process_in(name ++ " " ++ (args |> String.concat(~sep=" ")));
|
Unix.open_process_in(name ++ " " ++ (args |> String.concat(~sep=" ")));
|
||||||
let stdout_content = stdout_chan |> In_channel.input_all;
|
let stdout_content = stdout_chan |> In_channel.input_all;
|
||||||
|
|
@ -10,6 +10,7 @@ let run_process = (name, args) => {
|
||||||
(exit_code, stdout_content);
|
(exit_code, stdout_content);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*** Run nix with some fixed arguments, appending a user provided set of arguments. */
|
||||||
let nix = args =>
|
let nix = args =>
|
||||||
run_process(
|
run_process(
|
||||||
"nix",
|
"nix",
|
||||||
|
|
@ -17,7 +18,7 @@ let nix = args =>
|
||||||
);
|
);
|
||||||
|
|
||||||
let hash_files = filenames => {
|
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.
|
Returns Some(hex-string) or None if no filenames are found.
|
||||||
*/
|
*/
|
||||||
let ctx = Sha1.init();
|
let ctx = Sha1.init();
|
||||||
|
|
@ -27,7 +28,6 @@ let hash_files = filenames => {
|
||||||
switch (Sys_unix.file_exists(f)) {
|
switch (Sys_unix.file_exists(f)) {
|
||||||
| `Yes => true
|
| `Yes => true
|
||||||
| _ =>
|
| _ =>
|
||||||
// let fullpth = Filename_unix.realpath(f);
|
|
||||||
Printf.eprintf(
|
Printf.eprintf(
|
||||||
"Cannot find file %s (cwd: %s)\n",
|
"Cannot find file %s (cwd: %s)\n",
|
||||||
f,
|
f,
|
||||||
|
|
@ -53,6 +53,7 @@ let hash_files = filenames => {
|
||||||
};
|
};
|
||||||
|
|
||||||
let rec rmrf = path => {
|
let rec rmrf = path => {
|
||||||
|
/*** Remove [path] recursively */
|
||||||
switch (Unix.lstat(path).st_kind) {
|
switch (Unix.lstat(path).st_kind) {
|
||||||
| exception (Unix.Unix_error(_, _, _)) => ()
|
| exception (Unix.Unix_error(_, _, _)) => ()
|
||||||
| S_REG
|
| S_REG
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue