Skip to content

Commit d987893

Browse files
committed
simplify root package detection when running install.
1 parent 8254691 commit d987893

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/clib-install.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -406,25 +406,10 @@ int main(int argc, char *argv[]) {
406406
logger_error("error", "Failed to initialize cURL");
407407
}
408408

409-
if (!root_package) {
410-
const char *name = NULL;
411-
char *json = NULL;
412-
unsigned int i = 0;
409+
root_package = clib_package_load_local_manifest(opts.verbose);
413410

414-
do {
415-
name = manifest_names[i];
416-
json = fs_read(name);
417-
} while (NULL != manifest_names[++i] && !json);
418-
419-
if (json) {
420-
root_package = clib_package_new(json, opts.verbose);
421-
422-
if (root_package && root_package->prefix && !opts.prefix) {
423-
opts.prefix = root_package->prefix;
424-
}
425-
426-
free(json);
427-
}
411+
if (root_package && root_package->prefix && !opts.prefix) {
412+
opts.prefix = root_package->prefix;
428413
}
429414

430415
if (opts.prefix) {

0 commit comments

Comments
 (0)