Skip to content

Commit

Permalink
fix: ensure not passing in 'tags' breaks command
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaRamirez committed Jan 14, 2018
1 parent 7a95b7c commit 98740bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/new-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ function createNewPost(title, date, emoji, tags) {
let postDate = date != null ? date : `${padZero(internalDate.getMonth() + 1)}-${padZero(internalDate.getDate())}-${internalDate.getFullYear().toString().split('').slice(-2).join('')}`;
let postData = data;
let postDataArticles = postData.articles;
let postTags = tags.split(',');
let postTags = tags ? tags.split(',').map(s => s.trim()) : [];

postDataArticles.unshift({
link: './posts/' + postTitleDashed,
title: postTitle,
date: postDate.replace(/-/g, '/'),
emoji: emoji || '',
tags: postTags || [],
tags: postTags,
});

data.articles = postDataArticles;
Expand Down

0 comments on commit 98740bf

Please sign in to comment.