Skip to content

Commit

Permalink
#341 fix bug in installer
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Apr 9, 2016
1 parent 815a43e commit 4d84adf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tools/corto/src/cortotool_install.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,37 +124,43 @@ corto_int16 cortotool_install(int argc, char *argv[]) {
CORTO_UNUSED(argc);
CORTO_UNUSED(argv);
corto_bool installRemote = FALSE;
corto_bool installLocal = FALSE;
corto_ll verbose = NULL, dirs = NULL;

corto_argdata *data = corto_argparse(
argv,
(corto_argdata[]){
{"$0", NULL, NULL}, /* Ignore 'install' */
{"--verbose", &verbose, NULL},
{"$*", &dirs, NULL},
{"*", &dirs, NULL},
{NULL}
}
);

if (dirs && corto_llSize(dirs)) {
corto_string dir = corto_llGet(dirs, 0);
if (strchr(dir, ':') || corto_chdir(dir)) {
if (strchr(dir, '/') || corto_chdir(dir)) {
installRemote = TRUE;
} else {
if (!cortotool_validProject()) {
installRemote = TRUE;
} else {
installLocal = TRUE;
}
}
}

if (!installRemote) {
if (installLocal) {
if (cortotool_installFromSource(verbose ? TRUE : FALSE)) {
goto error;
}
} else {
} else if (installRemote){
if (cortotool_installFromRemote(argv[1])) {
goto error;
}
} else {
corto_error("corto: nothing to install");
goto error;
}

cortotool_promptPassword();
Expand Down

0 comments on commit 4d84adf

Please sign in to comment.