@caweb/cli 1.3.11 → 1.3.12
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 +23 -21
- package/package.json +1 -1
package/commands/sync.js
CHANGED
|
@@ -133,14 +133,15 @@ export default async function sync({
|
|
|
133
133
|
* Sync Process
|
|
134
134
|
* If taxonomy is undefined then we don't sync that section.
|
|
135
135
|
*
|
|
136
|
-
* 1)
|
|
137
|
-
* 2) We
|
|
136
|
+
* 1) We collect media if the taxonomy is undefined or includes media, pages, posts.
|
|
137
|
+
* 2) We only collect settings if the taxonomy is undefined or it's set to settings.
|
|
138
138
|
* 3) We only collect pages if the taxonomy is undefined or it's set to pages.
|
|
139
139
|
* 4) We only collect posts if the taxonomy is undefined or it's set to posts.
|
|
140
140
|
* 5) We only collect menus if the taxonomy is undefined or it's set to menus.
|
|
141
141
|
* - We also collect menu items if menus are collected.
|
|
142
142
|
*/
|
|
143
143
|
let settings = [];
|
|
144
|
+
let mediaLibrary = [];
|
|
144
145
|
let media = [];
|
|
145
146
|
let pages = [];
|
|
146
147
|
let posts = [];
|
|
@@ -148,24 +149,26 @@ export default async function sync({
|
|
|
148
149
|
let menuNavItems = [];
|
|
149
150
|
|
|
150
151
|
// Media Library.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
if( undefined === tax || tax.includes('media', 'pages', 'posts') ){
|
|
153
|
+
spinner.text = `Collecting Media Library ${from.url}`;
|
|
154
|
+
mediaLibrary = await getTaxonomies({
|
|
155
|
+
...fromOptions,
|
|
156
|
+
fields: [
|
|
157
|
+
'id',
|
|
158
|
+
'source_url',
|
|
159
|
+
'title',
|
|
160
|
+
'caption',
|
|
161
|
+
'alt_text',
|
|
162
|
+
'date',
|
|
163
|
+
'mime_type',
|
|
164
|
+
'post',
|
|
165
|
+
'media_details'
|
|
166
|
+
],
|
|
167
|
+
include: tax && tax.includes('media') && include ? include.join(',') : null
|
|
168
|
+
},
|
|
169
|
+
'media'
|
|
170
|
+
);
|
|
171
|
+
}
|
|
169
172
|
|
|
170
173
|
// Site Settings.
|
|
171
174
|
if( undefined === tax || tax.includes('settings') ){
|
|
@@ -339,7 +342,6 @@ export default async function sync({
|
|
|
339
342
|
'meta',
|
|
340
343
|
'menus'
|
|
341
344
|
],
|
|
342
|
-
include: tax && include ? include.join(',') : null,
|
|
343
345
|
menus: menus.map((menu) => { return menu.id; })
|
|
344
346
|
},
|
|
345
347
|
'menu-items'
|