diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-17 07:38:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-17 07:38:11 +0000 |
commit | d1801d1e6f670f245e0deb5edde46e1daf131c78 (patch) | |
tree | 87972441ed083bdd8ae4f511388bd4acc0a85988 /pre_commit/store.py | |
parent | Adding upstream version 2.12.1. (diff) | |
download | pre-commit-d1801d1e6f670f245e0deb5edde46e1daf131c78.tar.xz pre-commit-d1801d1e6f670f245e0deb5edde46e1daf131c78.zip |
Adding upstream version 2.13.0.upstream/2.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/store.py')
-rw-r--r-- | pre_commit/store.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pre_commit/store.py b/pre_commit/store.py index 187c9d3..0fd5e62 100644 --- a/pre_commit/store.py +++ b/pre_commit/store.py @@ -188,15 +188,20 @@ class Store: LOCAL_RESOURCES = ( 'Cargo.toml', 'main.go', 'go.mod', 'main.rs', '.npmignore', - 'package.json', 'pre_commit_dummy_package.gemspec', 'setup.py', - 'environment.yml', 'Makefile.PL', 'renv.lock', + 'package.json', 'pre_commit_placeholder_package.gemspec', 'setup.py', + 'environment.yml', 'Makefile.PL', + 'renv.lock', 'renv/activate.R', 'renv/LICENSE.renv', ) def make_local(self, deps: Sequence[str]) -> str: def make_local_strategy(directory: str) -> None: for resource in self.LOCAL_RESOURCES: - contents = resource_text(f'empty_template_{resource}') - with open(os.path.join(directory, resource), 'w') as f: + resource_dirname, resource_basename = os.path.split(resource) + contents = resource_text(f'empty_template_{resource_basename}') + target_dir = os.path.join(directory, resource_dirname) + target_file = os.path.join(target_dir, resource_basename) + os.makedirs(target_dir, exist_ok=True) + with open(target_file, 'w') as f: f.write(contents) env = git.no_git_env() |