Question about and system variables

Hello, I have a question because I didn’t found an answer. I would like to use to exec a make command, but I would like before the make command to change a global variable, the DESTDIR variable, how can I do that with ?

For example to have the same result as the bash command: DESTDIR=/temp/tempdir make install

Actually I have a function doing something like that:

def makeSource(arguments : Array(String), path =
            process ="make",   args: arguments,
                                            output: :inherit,
                                            error: :inherit,
                                            chdir:  Ism.settings.sourcesPath + "/" + 
                                                    @information.versionName + "/" +
                                                    @mainSourceDirectoryName + "/" +
            if !process.success?
                exit 1

But I would like to add the possibility to override the DESTDIR variable has an env parameter you can use to set it.

Something like: "make", env: {"DESTDIR" => "/temp/tempdir"}, ...

ref: Process - Crystal 1.6.2

1 Like