Skip to content

Commit

Permalink
Optional carbon
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Jun 14, 2024
1 parent 05b6ba1 commit 99b3df1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/make_measurement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ function make_measurement() {

if [[ $send_data == 'true' ]]; then

source "$(dirname "$0")/misc.sh" get_energy_co2 "$step_energy"
source "$(dirname "$0")/misc.sh" get_embodied_co2 "$step_time"
if [[ ${show_carbon} == 'true' ]]; then
source "$(dirname "$0")/misc.sh" get_energy_co2 "$step_energy"
source "$(dirname "$0")/misc.sh" get_embodied_co2 "$step_time"
fi

# CO2 API might have failed, so we only calculate total if it worked
# CO2 API might have failed or not set, so we only calculate total if it worked
CO2EQ_EMBODIED=${CO2EQ_EMBODIED:-} # Default to an empty string if unset
CO2EQ_ENERGY=${CO2EQ_ENERGY:-} # Default to an empty string if unset

Expand Down

0 comments on commit 99b3df1

Please sign in to comment.