mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed meta is missing error with revue imports (#16033)
refs:
5f90baf6fe
- The check for hasIssuesCSV didn't normalize the filename first,
meaning the importer is super sensitive to zip structure
- This allows for zips that contain a directory, so that it will still
be processed as a revue import, not a Ghost import
This commit is contained in:
parent
1f5a752b71
commit
1b5aa390f1
1 changed files with 5 additions and 3 deletions
|
@ -2,9 +2,10 @@ const _ = require('lodash');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const debug = require('@tryghost/debug')('importer:handler:revue');
|
const debug = require('@tryghost/debug')('importer:handler:revue');
|
||||||
|
|
||||||
const hasIssuesCSV = (files) => {
|
const hasIssuesCSV = (files, startDirRegex) => {
|
||||||
return _.some(files, (file) => {
|
return _.some(files, (file) => {
|
||||||
return file.name.match(/^issues.*?\.csv/);
|
const name = file.name.replace(startDirRegex, '');
|
||||||
|
return name.match(/^issues.*?\.csv/);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,7 +22,8 @@ const RevueHandler = {
|
||||||
const ops = [];
|
const ops = [];
|
||||||
const revue = {};
|
const revue = {};
|
||||||
|
|
||||||
if (!hasIssuesCSV(files)) {
|
if (!hasIssuesCSV(files, startDirRegex)) {
|
||||||
|
debug('No issue CSV');
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue