-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from cloudblue/windows_installer
v24.5
- Loading branch information
Showing
20 changed files
with
700 additions
and
1,196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
import os | ||
import shutil | ||
import stat | ||
|
||
from cookiecutter import generate | ||
from cookiecutter.config import DEFAULT_CONFIG | ||
from cookiecutter.utils import rmtree | ||
|
||
|
||
def force_delete(func, path, exc_info): | ||
os.chmod(path, stat.S_IWRITE) | ||
func(path) | ||
|
||
|
||
def purge_cookiecutters_dir(): | ||
# Avoid asking rewrite clone boilerplate project | ||
cookie_dir = DEFAULT_CONFIG['cookiecutters_dir'] | ||
if os.path.isdir(cookie_dir): | ||
rmtree(cookie_dir) | ||
shutil.rmtree(cookie_dir, onerror=force_delete) | ||
|
||
|
||
def slugify(name): | ||
return name.lower().strip().replace(' ', '_').replace('-', '_').replace('.', '_').replace(',', '') | ||
|
||
|
||
def remove_github_actions(project_dir: str): | ||
shutil.rmtree(f'{project_dir}/.github') | ||
|
||
|
||
def monkey_patch(): | ||
def _run_hook_from_repo_dir( | ||
repo_dir, hook_name, project_dir, context, delete_project_on_failure, | ||
): # pragma: no cover | ||
'''Fake method for monkey patching purposes''' | ||
pass | ||
generate._run_hook_from_repo_dir = _run_hook_from_repo_dir |
Oops, something went wrong.