diff options
-rw-r--r-- | include/utils.h | 3 | ||||
-rw-r--r-- | src/deliverable.c | 21 | ||||
-rw-r--r-- | src/utils.c | 21 |
3 files changed, 24 insertions, 21 deletions
diff --git a/include/utils.h b/include/utils.h index 37ba50a..43bb618 100644 --- a/include/utils.h +++ b/include/utils.h @@ -308,4 +308,7 @@ char *collapse_whitespace(char **s); * @return 0 on success, -1 on error */ int redact_sensitive(const char **to_redact, char *src, char *dest, size_t maxlen); + +struct StrList *listdir(const char *path); + #endif //OMC_UTILS_H diff --git a/src/deliverable.c b/src/deliverable.c index dbbaecb..4318f53 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -1293,27 +1293,6 @@ int delivery_copy_wheel_artifacts(struct Delivery *ctx) { return system(cmd); } -static struct StrList *listdir(const char *path) { - struct StrList *node; - DIR *dp; - struct dirent *rec; - - dp = opendir(path); - if (!dp) { - return NULL; - } - node = strlist_init(); - - while ((rec = readdir(dp)) != NULL) { - if (!strcmp(rec->d_name, ".") || !strcmp(rec->d_name, "..")) { - continue; - } - strlist_append(&node, rec->d_name); - } - closedir(dp); - return node; -} - int delivery_index_wheel_artifacts(struct Delivery *ctx) { struct dirent *rec; DIR *dp; diff --git a/src/utils.c b/src/utils.c index c1f78e5..a4230d3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -712,3 +712,24 @@ int redact_sensitive(const char **to_redact, char *src, char *dest, size_t maxle return 0; } +struct StrList *listdir(const char *path) { + struct StrList *node; + DIR *dp; + struct dirent *rec; + + dp = opendir(path); + if (!dp) { + return NULL; + } + node = strlist_init(); + + while ((rec = readdir(dp)) != NULL) { + if (!strcmp(rec->d_name, ".") || !strcmp(rec->d_name, "..")) { + continue; + } + strlist_append(&node, rec->d_name); + } + closedir(dp); + return node; +} + |