Skip to content

Commit

Permalink
Merge pull request #5 from DivineDominion/patch-2
Browse files Browse the repository at this point in the history
replace Windows-only "\" with "/" as path separator
  • Loading branch information
ytechie committed Jul 2, 2019
2 parents cc0d00c + 41a365e commit fad373d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ function processPost(post) {
}
}

var fullPath = 'out\\' + postDate.getFullYear() + '\\' + getPaddedMonthNumber(postDate.getMonth() + 1) + '\\' + slug;
var fullPath = 'out/' + postDate.getFullYear() + '/' + getPaddedMonthNumber(postDate.getMonth() + 1) + '/' + slug;

fs.mkdir('out\\' + postDate.getFullYear(), function() {
fs.mkdir('out\\' + postDate.getFullYear() + '\\' + getPaddedMonthNumber(postDate.getMonth() + 1), function() {
fs.mkdir('out/' + postDate.getFullYear(), function() {
fs.mkdir('out/' + postDate.getFullYear() + '/' + getPaddedMonthNumber(postDate.getMonth() + 1), function() {
fs.mkdir(fullPath, function() {
//Find all images
var patt = new RegExp("(?:src=\"(.*?)\")", "gi");
Expand All @@ -80,7 +80,7 @@ function processPost(post) {
var urlParts = matches[i].split('/');
var imageName = urlParts[urlParts.length - 1];

var filePath = fullPath + '\\' + imageName;
var filePath = fullPath + '/' + imageName;

downloadFile(url, filePath);

Expand Down Expand Up @@ -125,7 +125,7 @@ function processPost(post) {
header += "---\n";
header += "\n";

fs.writeFile(fullPath + '\\index.html.md', header + markdown, function(err) {
fs.writeFile(fullPath + '/index.html.md', header + markdown, function(err) {

});
});
Expand Down

0 comments on commit fad373d

Please sign in to comment.