ultimate-jekyll-manager 0.0.155 → 0.0.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -102,12 +102,17 @@ class GitHubCache {
|
|
|
102
102
|
this.logger.log(`📂 Extract directory: ${extractDir}`);
|
|
103
103
|
this.logger.log(`📁 Directory contents: ${JSON.stringify(dirContents)}`);
|
|
104
104
|
|
|
105
|
+
// GitHub zipball format: {owner}-{repo}-{sha}
|
|
106
|
+
// Match this pattern to avoid picking up other cache directories (like imagemin, translation)
|
|
107
|
+
const githubZipPattern = new RegExp(`^${this.owner}-${this.repo}-[a-f0-9]+$`, 'i');
|
|
108
|
+
|
|
105
109
|
const extractedRoot = dirContents.find(name => {
|
|
106
110
|
const fullPath = path.join(extractDir, name);
|
|
107
111
|
const isDir = jetpack.exists(fullPath) === 'dir';
|
|
108
112
|
const isNotZip = name !== zipFileName;
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
const matchesGitHubPattern = githubZipPattern.test(name);
|
|
114
|
+
this.logger.log(` - ${name}: isDir=${isDir}, isNotZip=${isNotZip}, matchesGitHubPattern=${matchesGitHubPattern}`);
|
|
115
|
+
return isNotZip && isDir && matchesGitHubPattern;
|
|
111
116
|
});
|
|
112
117
|
|
|
113
118
|
this.logger.log(`✅ Found extracted root: ${extractedRoot || 'NONE'}`);
|