How to "Take" the value of the COMPOSER_PROCESS_TIMEOUT variable?

Asked

Viewed 15 times

0

I’m using a script bash to define the variable COMPOSER_PROCESS_TIMEOUT, but before I change the value of it I need to know what is the value that is defined.

I took a good look on the internet and found nothing similar, not even in the documentation of Composer.

Setting a new value for COMPOSER_PROCESS_TIMEOUT

    setComposerProcessTimeout(){
        echo "Defining the COMPOSER_PROCESS_TIMEOUT = 2000"
        composer --global config process-timeout 2000
    }

How to catch the COMPOSER_PROCESS_TIMEOUT and use it as in the script below:

    COMPOSER_TIMEOUT_VALUE = #(Não sei como pegar o valor).

    if !${COMPOSER_TIMEOUT_VALUE} == 300 ; then
      echo ${COMPOSER_TIMEOUT_VALUE}
    fi

1 answer

1

I’ll leave the solution here to help in case anyone needs it

I was able to get the value using the command below:

COMPOSER_PROCESS_TIMEOUT_VALUE=$(composer --global config process-timeout)

And then I can use in if as per example:

setComposerProcessTimeout() {

    if [[ "${COMPOSER_PROCESS_TIMEOUT_VALUE}" != "2000" ]]; then
        echo "Defining COMPOSER_PROCESS_TIMEOUT to 2000"
        composer --global config process-timeout 2000
    fi
    exit
}

So I can take and compare the variable and reset it if I have to.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.