Skip to content

Commit

Permalink
Merge pull request #22 from UNSW-CEEM/hotfix-non-git-repo
Browse files Browse the repository at this point in the history
Hotfix analysis failed if not in a git repo
  • Loading branch information
phoebeheywood authored May 18, 2023
2 parents cb1f89b + c7fefcd commit aba8bd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion run_analysis/run_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,11 @@ run_analysis <- function(data, settings) {
circ_sum_cols <- append(circ_sum_cols, c("Islanded", "island_assessment", "islanding_alert"), 26)
}
data$circuit_summary <- data$circuit_summary[, circ_sum_cols]
data$circuit_summary$tool_hash <-git2r::revparse_single(revision="HEAD")$sha
if(is.null(git2r::discover_repository(path = ".", ceiling = NULL))){
data$circuit_summary$tool_hash <- Sys.Date()
} else {
data$circuit_summary$tool_hash <-git2r::revparse_single(revision="HEAD")$sha
}

# Combine data sets that have the same grouping so they can be saved in a single file
if (no_grouping){
Expand Down

0 comments on commit aba8bd0

Please sign in to comment.