]> pd.if.org Git - zpackage/commitdiff
use environment variables for scripts
authorNathan Wagner <nw@hydaspes.if.org>
Mon, 26 Nov 2018 08:48:27 +0000 (08:48 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 26 Nov 2018 08:48:27 +0000 (08:48 +0000)
zpm-script.c

index d947f058b68c9a9076ec02ebb7089c5574613452..b8c94589f5d623d4463bc0a5a91b941e20eb5527 100644 (file)
@@ -143,6 +143,7 @@ int main(int ac, char **av){
        char *script = "/var/tmp/zpm-script";
        char *output = "/var/tmp/zpm-script.out";
        char *phase = 0;
+       char *envvar = 0;
        int quiet = 0;
        int scriptishash = 0;
        int mode = RUN;
@@ -154,6 +155,16 @@ int main(int ac, char **av){
 
        rootdir = getenv("ZPM_ROOT_DIR");
 
+       envvar = getenv("ZPM_SCRIPT_FILE");
+       if (envvar) {
+               script = envvar;
+       }
+
+       envvar = getenv("ZPM_SCRIPT_OUTPUT");
+       if (envvar) {
+               output = envvar;
+       }
+
        /* run, set, show, hash */
        /* set -S, if -H set the hash, output hash, unless quiet
         * show: -o, or stdout,