🐛 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
@ -2,9 +2,10 @@ const _ = require('lodash');
|
||||
const fs = require('fs-extra');
|
||||
const debug = require('@tryghost/debug')('importer:handler:revue');
|
||||
|
||||
const hasIssuesCSV = (files) => {
|
||||
const hasIssuesCSV = (files, startDirRegex) => {
|
||||
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 revue = {};
|
||||
|
||||
if (!hasIssuesCSV(files)) {
|
||||
if (!hasIssuesCSV(files, startDirRegex)) {
|
||||
debug('No issue CSV');
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user