@caweb/cli 1.3.4 → 1.3.6
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.
- package/commands/sync.js +3 -4
- package/package.json +1 -1
package/commands/sync.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
getTaxonomies,
|
|
15
15
|
createTaxonomies
|
|
16
16
|
} from '../lib/index.js';
|
|
17
|
-
import { get } from 'http';
|
|
18
17
|
|
|
19
18
|
const errors = [];
|
|
20
19
|
|
|
@@ -29,7 +28,7 @@ const errors = [];
|
|
|
29
28
|
*/
|
|
30
29
|
async function getParentItems( objects, request, tax = 'pages' ){
|
|
31
30
|
let parentItemsObjects = [];
|
|
32
|
-
let objectParentIds = objects.map((obj) => { return obj.parent; });
|
|
31
|
+
let objectParentIds = objects.map((obj) => { return obj.parent; }).filter(n => n);
|
|
33
32
|
|
|
34
33
|
while( objectParentIds.length > 0 ){
|
|
35
34
|
|
|
@@ -77,7 +76,7 @@ export default async function sync({
|
|
|
77
76
|
|
|
78
77
|
const localFile = path.join(appPath, 'caweb.json');
|
|
79
78
|
const {workDirectoryPath} = await loadConfig(path.resolve('.'));
|
|
80
|
-
|
|
79
|
+
|
|
81
80
|
process.env.WP_CLI_CONFIG_PATH = path.join(workDirectoryPath, 'config.yml');
|
|
82
81
|
|
|
83
82
|
// if caweb.json file doesn't exist we don't do anything
|
|
@@ -163,7 +162,7 @@ export default async function sync({
|
|
|
163
162
|
'post',
|
|
164
163
|
'media_details'
|
|
165
164
|
],
|
|
166
|
-
include: tax.includes('media') && include ? include.join(',') : null
|
|
165
|
+
include: tax && tax.includes('media') && include ? include.join(',') : null
|
|
167
166
|
},
|
|
168
167
|
'media'
|
|
169
168
|
);
|