{"record":{"id":"4a2269f9b80a3448","repo":"a-b-street/abstreet","slug":"your-current-directory-doesn-t-have-the-data-directory-run","errorCode":null,"errorMessage":"Your current directory doesn't have the data/ directory. Run from the git root: cd ../; cargo run --bin updater -- args","messagePattern":"Your current directory doesn't have the data/ directory\\. Run from the git root: cd \\.\\./; cargo run --bin updater -- args","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"updater/src/main.rs","lineNumber":64,"sourceCode":"        minimal: bool,\n        /// Only update files from the manifest. Leave extra files alone.\n        #[structopt(long)]\n        dont_delete: bool,\n        /// Only useful for Dustin. \"Download\" from my local S3 source-of-truth, not from the\n        /// network.\n        #[structopt(long)]\n        dl_from_local: bool,\n        /// Download data tied to a named release. See\n        /// https://a-b-street.github.io/docs/tech/dev/data.html.\n        #[structopt(long, default_value = \"dev\")]\n        version: String,\n    },\n}\n\n#[tokio::main]\nasync fn main() {\n    if !std::path::Path::new(\"data\").exists() {\n        panic!(\"Your current directory doesn't have the data/ directory. Run from the git root: cd ../; cargo run --bin updater -- args\");\n    }\n\n    abstutil::logger::setup();\n    match Task::from_args() {\n        Task::Upload => {\n            upload(\"dev\");\n        }\n        Task::IncrementalUpload { version } => {\n            // We DON'T want to override the main data immediately from the batch Docker jobs. If\n            // running locally, can temporarily disable this assertion.\n            assert_ne!(version, \"dev\");\n            incremental_upload(version);\n        }\n        Task::DryRun { single_file } => {\n            if let Some(path) = single_file {\n                let local = md5sum(&path);\n                let truth = Manifest::load()\n                    .entries","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/updater/src/main.rs#L46-L82","documentation":"The updater binary requires the current working directory to be the repository root, because it reads and writes the data/ tree. At startup it checks that data/ exists and panics with instructions if not.","triggerScenarios":"Running `cargo run --bin updater` from any directory other than the git root, so `data/` is not a relative path in the CWD.","commonSituations":"Developers running the updater from within updater/src, a CI step with the wrong working directory, or after cloning without data/ present.","solutions":["cd to the git repository root before running the updater","Ensure data/ exists at the repo root (run the data setup/import steps if the repo was freshly cloned without data)","In CI/scripts, set working-directory to the repo root"],"exampleFix":"// before (from updater/)\ncargo run --bin updater -- args\n// after (from git root)\ncd ..\ncargo run --bin updater -- args","handlingStrategy":"validation","validationCode":"if !std::path::Path::new(\"data\").exists() {\n    eprintln!(\"run from the git root\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run updater from the repo root; wrap invocations in scripts that cd first","Set working-directory in CI to the repo root","Ensure data/ exists before invoking the updater"],"tags":["rust","panic","working-directory","cli"],"backgroundTag":"directory-not-found","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}