Skip to content

Commit 03ba7f5

Browse files
author
sanscontext
committed
revert original catalog script and catalogs
1 parent 90a3998 commit 03ba7f5

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

scripts/catalog.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const slugify = (displayName) => {
2222
if (slug === 'roku-alpha') slug = 'roku'
2323
if (slug === 'shopify-by-littledata') slug = 'shopify-littledata'
2424
if (slug === 'talon-one') slug = 'talonone'
25+
if (slug == 'google-adwords-remarketing-lists-customer-match') slug = 'adwords-remarketing-lists'
26+
if (slug == 'canny-classic') slug = 'canny'
2527
return slug
2628
}
2729

@@ -329,9 +331,6 @@ const updateDestinations = async () => {
329331

330332
let tempCategories = [destination.categories.primary, destination.categories.secondary, ...destination.categories.additional]
331333
tempCategories = tempCategories.filter(category => category != '')
332-
console.log(tempCategories)
333-
334-
console.log(tempCategories)
335334

336335
let connection_modes = getConnectionModes({
337336
components: destination.components,
@@ -389,8 +388,9 @@ const updateDestinations = async () => {
389388

390389
// add unique destination categories to set
391390
tempCategories.reduce((s, e) => s.add(e), categories);
391+
392392
})
393-
393+
394394
const destinationArray = Array.from(categories)
395395
destinationArray.forEach(category => {
396396
destinationCategories.push({
@@ -400,20 +400,20 @@ const updateDestinations = async () => {
400400
})
401401

402402
// Create destination catalog yaml file
403-
// const options = { noArrayIndent: true };
404-
// output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
405-
// var todayDate = new Date().toISOString().slice(0,10);
406-
// output += "# destination data last updated " + todayDate + " \n";
407-
// output += yaml.safeDump({ items: destinationsUpdated }, options);
408-
// fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations.yml`), output);
403+
const options = { noArrayIndent: true };
404+
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
405+
var todayDate = new Date().toISOString().slice(0,10);
406+
output += "# destination data last updated " + todayDate + " \n";
407+
output += yaml.safeDump({ items: destinationsUpdated }, options);
408+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations.yml`), output);
409409

410410
// Create destination-category mapping yaml file
411-
// output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
412-
// var todayDate = new Date().toISOString().slice(0,10);
413-
// output += "# destination categories last updated " + todayDate + " \n";
414-
// output += yaml.safeDump({ items: destinationCategories }, options);
415-
// fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories.yml`), output);
411+
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
412+
var todayDate = new Date().toISOString().slice(0,10);
413+
output += "# destination categories last updated " + todayDate + " \n";
414+
output += yaml.safeDump({ items: destinationCategories }, options);
415+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories.yml`), output);
416416
}
417417

418-
//updateSources()
418+
updateSources()
419419
updateDestinations()

0 commit comments

Comments
 (0)