Resolve code root directory
parse_code_root.RdDetermines the absolute path to the code root, using environment variables and project structure.
Details
Ensures all relative paths in the pipeline resolve correctly.
Uses WEIGHTING_CODE_PATH env var if set, else finds git root or working dir.
Handles R CMD CHECK and testthat environments for reproducible builds/tests.
Stops with error if path is not absolute during package checks.
See also
scripts/000_run_weight_scripts.R
Other settings management:
check_write_to_db(),
get_settings(),
parse_raw_data_root(),
parse_settings_path(),
set_defaults(),
update_data_root(),
update_directories(),
update_settings_pums_vars()
Examples
## Not run:
Sys.setenv(WEIGHTING_CODE_PATH = getwd())
parse_code_root()
#> Error in parse_code_root(): could not find function "parse_code_root"
## End(Not run)