Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions scripts/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const slugify = (displayName) => {
.replace('.','-')

if (slug === '-net') slug = 'net'
if (slug === 'talon-one') slug = 'talonone'
if (slug === 'roku-alpha') slug = 'roku'
if (slug === 'shopify-by-littledata') slug = 'shopify-littledata'
if (slug === 'talon-one') slug = 'talonone'
Expand Down Expand Up @@ -189,11 +190,16 @@ const updateSources = async () => {

// Create source catalog yaml file
const options = { noArrayIndent: true };
let output = yaml.safeDump({ items: sourcesUpdated }, options);
var todayDate = new Date().toISOString().slice(0,10);
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
output += "# sources last updated " + todayDate + " \n";
output += yaml.safeDump({ items: sourcesUpdated }, options);
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/sources.yml`), output);

// Create source-category mapping yaml file
var todayDate = new Date().toISOString().slice(0,10);
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
output += "# source cateogries last updated " + todayDate + " \n";
output += yaml.safeDump({ items: sourceCategories }, options);
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/source_categories.yml`), output);
}
Expand Down Expand Up @@ -272,10 +278,16 @@ const updateDestinations = async () => {

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

// Create destination-category mapping yaml file
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
var todayDate = new Date().toISOString().slice(0,10);
output += "# destination categories last updated " + todayDate + " \n";
output += yaml.safeDump({ items: destinationCategories }, options);
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories.yml`), output);
}
Expand Down
1 change: 1 addition & 0 deletions src/_data/catalog/destination_categories.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT
# destination categories last updated 2020-01-22
items:
- display_name: Email Marketing
slug: email-marketing
Expand Down
Loading