fn build_path(state: &State, cmd: &mut BuiltinCommand) -> Result<PathBuf, Error>