aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/sledjchisl/sledjchisl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sledjchisl/sledjchisl.c')
-rw-r--r--src/sledjchisl/sledjchisl.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c
index 3e216c0..e63cdec 100644
--- a/src/sledjchisl/sledjchisl.c
+++ b/src/sledjchisl/sledjchisl.c
@@ -7669,7 +7669,7 @@ int scanForConfigs(char **cPaths)
7669void sledjchisl_main(void) 7669void sledjchisl_main(void)
7670{ 7670{
7671 char *cmd = *toys.optargs; 7671 char *cmd = *toys.optargs;
7672 char *tmp, *t0, *t1; 7672 char *tmp, *t0 = NULL, *t1 = NULL;
7673 struct stat statbuf; 7673 struct stat statbuf;
7674 int status, result, i; 7674 int status, result, i;
7675 void *vd; 7675 void *vd;
@@ -7795,11 +7795,19 @@ Other possibilities -
7795 if (qfile_exist(toybuf)) 7795 if (qfile_exist(toybuf))
7796 { 7796 {
7797 chdir(toybuf); 7797 chdir(toybuf);
7798 free(pwd);
7799 pwd = xgetcwd();
7800 I("Now running in directory %s", pwd);
7801 free(t0);
7802 t0 = realpath(pwd, NULL);
7798 result = scanForConfigs(cPaths); 7803 result = scanForConfigs(cPaths);
7799 result = result | scanForConfigs(oPaths); 7804 result = result | scanForConfigs(oPaths);
7800 } 7805 }
7801 else 7806 else
7807 {
7802 C("The configured scRoot doesn't exist! Might need to actually install this. %s", scRoot); 7808 C("The configured scRoot doesn't exist! Might need to actually install this. %s", scRoot);
7809 goto finished;
7810 }
7803 } 7811 }
7804 free(t1); 7812 free(t1);
7805 } 7813 }
@@ -7827,11 +7835,14 @@ Other possibilities -
7827 if ((tmp = configs->getstr(configs, "webIframers", false)) != NULL) {webIframers = tmp; V("Setting webIframers = %s", webIframers);} 7835 if ((tmp = configs->getstr(configs, "webIframers", false)) != NULL) {webIframers = tmp; V("Setting webIframers = %s", webIframers);}
7828 } 7836 }
7829 else 7837 else
7838 {
7830 C("No sledjChisl.conf.lua found!"); 7839 C("No sledjChisl.conf.lua found!");
7840 goto finished;
7841 }
7831 7842
7832 snprintf(toybuf, sizeof(toybuf), "%s/current/bin", scRoot); 7843 snprintf(toybuf, sizeof(toybuf), "%s/current/bin", scRoot);
7833 t1 = realpath(toybuf, NULL); 7844 t1 = realpath(toybuf, NULL);
7834 if (strcmp(t0, t1)) 7845 if ((NULL != t0) && (strcmp(t0, t1)))
7835 C("scRoot moved unexpectedly, check your sledjChisl.conf.lua files! %s != %s", t0, t1); 7846 C("scRoot moved unexpectedly, check your sledjChisl.conf.lua files! %s != %s", t0, t1);
7836 free(t1); 7847 free(t1);
7837 free(t0); 7848 free(t0);
@@ -7912,8 +7923,7 @@ Other possibilities -
7912 V("Not running inside the proper tmux server. %s == %s", eTMUX, toybuf); 7923 V("Not running inside the proper tmux server. %s == %s", eTMUX, toybuf);
7913 } 7924 }
7914 7925
7915// Note this block of code assumes we are running inside current/bin. Which RunIt.sh does for us. 7926// Note this block of code assumes we are running inside current/bin. Which RunIt.sh does for us. Earlier code also tries to ensure this.
7916// TODO - get rid of RunIt.sh as well.
7917 if (!isTmux) 7927 if (!isTmux)
7918 { // Let's see if the proper tmux server is even running. 7928 { // Let's see if the proper tmux server is even running.
7919 i = shellMe("%s %s/%s -q list-sessions 2>/dev/null | grep -q %s:", Tcmd, scRun, Tsocket, Tconsole); 7929 i = shellMe("%s %s/%s -q list-sessions 2>/dev/null | grep -q %s:", Tcmd, scRun, Tsocket, Tconsole);