@caweb/cli 1.3.6 → 1.3.7

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 CHANGED
@@ -173,6 +173,8 @@ export default async function sync({
173
173
  settings = await getTaxonomies({
174
174
  ...fromOptions,
175
175
  fields: [
176
+ 'title',
177
+ 'description',
176
178
  'show_on_front',
177
179
  'page_on_front',
178
180
  'posts_per_page'
@@ -237,11 +239,16 @@ export default async function sync({
237
239
  * 3) save any linked media in the content of pages and posts.
238
240
  */
239
241
  for( let m of mediaLibrary ){
242
+ // remove any new line characters.
243
+ m.source_url = m.source_url.replace('\n','');
244
+
240
245
  // check if the media is attached to a page.
241
246
  // if tax is undefined, we collect all media attached to posts and pages.
242
- // if tax is defined, we only collect media attached to posts and pages if the id match.
247
+ // if tax is defined, if include is undefined or media is matches post/page, we collect the media.
243
248
  if( ( ! tax && m.post ) ||
244
- ( tax && include.includes(m.id.toString()) ) ){
249
+ ( tax &&
250
+ ( undefined === include || include.includes( m.id.toString() ) )
251
+ ) ){
245
252
  media.push( m );
246
253
 
247
254
  // we don't have to check any further.
@@ -252,11 +259,11 @@ export default async function sync({
252
259
  // if the media is featured on a post or linked in the content.
253
260
  if( p.featured_media === m.id ||
254
261
  p.content.rendered.match( new RegExp(`src=”(${m.source_url}.*)”`, 'g') )){
255
- media.push( m );
256
- }
262
+ media.push( m );
263
+ }
257
264
  }
258
265
  }
259
-
266
+
260
267
  // filter any duplicate media.
261
268
  media = media.filter((m, index, self) => { return index === self.findIndex((t) => { return t.id === m.id; })} );
262
269
 
package/lib/cli.js CHANGED
@@ -272,12 +272,12 @@ export default function cli() {
272
272
 
273
273
  // Test Command.
274
274
  // Ensure this is commented out.
275
- program.command('test')
275
+ /*program.command('test')
276
276
  .description('Test commands on a WordPress environment')
277
277
  //.addArgument(envArg)
278
278
  .allowUnknownOption(true)
279
279
  .action(withSpinner(env.test))
280
-
280
+ */
281
281
  addWPEnvCommands();
282
282
 
283
283
  return program;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/cli",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "CAWebPublishing Command Line Interface.",
5
5
  "exports": "./lib/env.js",
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  "WP_DEBUG_DISPLAY": false,
49
49
  "WP_MEMORY_LIMIT": "256M",
50
50
  "WP_MAX_MEMORY_LIMIT": "512M",
51
- "WP_PERMALINK": "/%postname%/",
51
+ "WP_PERMALINK": "/%year%/%monthnum%/%postname%/",
52
52
  "ADMIN_COOKIE_PATH": "/",
53
53
  "COOKIE_DOMAIN": "",
54
54
  "COOKIEPATH": "",