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

Grunt job is not ignoring hidden directories #297

Open
ewallah opened this issue Apr 1, 2024 · 0 comments
Open

Grunt job is not ignoring hidden directories #297

ewallah opened this issue Apr 1, 2024 · 0 comments

Comments

@ewallah
Copy link

ewallah commented Apr 1, 2024

The grunt job is not ignoring hidden directories. The job copies the complete directory of a plugin to a temporary space, does an excellent job and mirrors is back. If you have for example a .git folder with special directory permissions, the restore fails with a permission denied error.

Failed to copy "/tmp/moodle-plugin-ci-grunt-backup-1711963880/.git/objects/57/..." to ".../.git/objects/57/..." because target file could not be opened for writing: fopen(../.git/objects/57/...): Failed to open stream: Permission denied

Therefore I changed the restorePlugin method

       $flags = \FilesystemIterator::SKIP_DOTS;
       $iterator = new \RecursiveDirectoryIterator($this->backupDir, $flags);
       (new Filesystem())->mirror($this->backupDir, $this->plugin->directory, $iterator, ['delete' => true, 'override' => true]);
ewallah added a commit to ewallah/moodle-plugin-ci that referenced this issue May 3, 2024
Grunt job is not ignoring hidden directories moodlehq#297
@ewallah ewallah mentioned this issue May 3, 2024
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

No branches or pull requests

1 participant