🐛 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:
Hannah Wolfe 2022-12-20 11:56:07 +00:00 committed by GitHub
parent 1f5a752b71
commit 1b5aa390f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}