def exists(config):
exists = (<EOL>pathlib.Path(config.cache_path).exists()<EOL>and pathlib.Path(config.cache_path).is_dir()<EOL>)<EOL>if not exists:<EOL><INDENT>return False<EOL><DEDENT>index_path = pathlib.Path(config.cache_path) / "<STR_LIT>"<EOL>if index_path.exists():<EOL><INDENT>with open(index_path, "<STR_LIT:r>") as out:<EOL><INDENT>index = json.load(out)<EOL><DEDENT>if index["<STR_LIT:version>"] != __version__:<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>)<EOL>create_index(config)<EOL><DEDENT>return True<EOL>
Check whether the .wily/ directory exists.

:param config: The configuration
:type  config: :class:`wily.config.WilyConfig`

:return: Whether the .wily directory exists
:rtype: ``boolean``