Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update a project's wscript when pushing to git if necessary. #343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions ide/tasks/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,23 @@ def update_expected_paths(new_path):
else:
next_tree[remote_manifest_path] = InputGitTreeElement(path=remote_manifest_path, mode='100644', type='blob',
content=generate_manifest(project, resources))

if project.project_type == 'native' and remote_wscript_path not in next_tree:
next_tree[remote_wscript_path] = InputGitTreeElement(path=remote_wscript_path, mode='100644', type='blob',
content=generate_wscript_file(project, True))
has_changed = True
# Add or update the project's wscript
if project.project_type in ('native', 'package', 'rocky'):
if remote_wscript_path not in next_tree:
# Add the wscript if it does not exist
next_tree[remote_wscript_path] = InputGitTreeElement(path=remote_wscript_path, mode='100644', type='blob',
content=generate_wscript_file(project, True))
has_changed = True
else:
# Update the wscript if need be
current_wscript = generate_wscript_file(project, True)
sha = next_tree[remote_wscript_path]._InputGitTreeElement__sha
expected_sha = git_sha(current_wscript)
if sha != expected_sha:
logger.debug("Updated wscript")
next_tree[remote_wscript_path]._InputGitTreeElement__sha = NotSet
next_tree[remote_wscript_path]._InputGitTreeElement__content = current_wscript
has_changed = True

# Commit the new tree.
if has_changed:
Expand Down