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

Better handling of .gitkeep in demo-files #2304

Merged
merged 3 commits into from
Sep 25, 2024
Merged

Better handling of .gitkeep in demo-files #2304

merged 3 commits into from
Sep 25, 2024

Conversation

bemoody
Copy link
Collaborator

@bemoody bemoody commented Sep 25, 2024

We use .gitkeep files as placeholders for "empty" directories. For example we have two demo active projects that don't contain any files, and we want the loaddemo command to create project directories for them. However, loaddemo (or TestMixin, which loads the demo files for the test suite) shouldn't create an actual .gitkeep file in the project directory.

Additionally, loaddemo shouldn't fail if the demo project directory already exists.

Should fix problems with test-upgrade.sh as seen in #2303.

Benjamin Moody added 3 commits September 25, 2024 13:44
Files called ".gitkeep" are used as placeholders to tell git to create
the directory.  They shouldn't be copied as part of the demo project
content (in fact, a file called ".gitkeep" would not be allowed by the
file upload form.)

For example, the demo active project AGlSZa5VTv5Dg09CSpoh contains no
actual files, but the git repository includes the file
demo-files/media/active-projects/AGlSZa5VTv5Dg09CSpoh/.gitkeep - so
in this case, loaddemo should create an empty project directory
media/active-projects/AGlSZa5VTv5Dg09CSpoh .
If a directory such as 'media/active-projects/AGlSZa5VTv5Dg09CSpoh'
already exists, and we are trying to install a demo project there,
don't raise an error.  That directory isn't present in the git
repository, but it might have been created in the past.
Files called ".gitkeep" are used as placeholders to tell git to create
the directory.  They shouldn't be copied as part of the demo project
content (in fact, a file called ".gitkeep" would not be allowed by the
file upload form.)

For example, the demo active project AGlSZa5VTv5Dg09CSpoh contains no
actual files, but the git repository includes the file
demo-files/media/active-projects/AGlSZa5VTv5Dg09CSpoh/.gitkeep - so in
this case, TestMixin should create an empty project directory.
@tompollard tompollard merged commit a276764 into dev Sep 25, 2024
8 checks passed
@tompollard tompollard deleted the bm/demo-gitkeep branch September 25, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants