Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mathblogging/mathblogging-base
Browse files Browse the repository at this point in the history
  • Loading branch information
pkra committed Jun 23, 2017
2 parents 806a16c + 4f46296 commit ca66d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions bin/run.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/bin/bash

MBHOME=$HOME/code/mathblogging-base

eval `ssh-agent`
ssh-add $HOME/.ssh/mb_id_rsa
cd $HOME/code/mathblogging-base && \
cd $MBHOME && \
echo "Clean Old Feeds" && \
find ../feeds -mtime +31 -type f -delete && \
find feeds -mtime +31 -type f -delete && \
echo "Start FeedFetchTrimmer" && \
nodejs run_feedFetchTrimmer.js && \
node bin/run_feedFetchTrimmer.js && \
echo "Start app.js" && \
nodejs ../lib/app.js && \
node lib/app.js && \
echo "Do git commit and push" && \
cd $HOME/code/mathblogging-base/mathblogging.org && \
cd mathblogging.org && \
git add -u && \
git commit -m "`date`" && \
git push
4 changes: 2 additions & 2 deletions lib/feedFetchTrimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const got = require('got');
const Feed = require('rss');
const sanitize = require('sanitize-filename');

const categoryToUrl = require('./helpers.js').sortFeedByDate;
const sortFeedByDate = require('./helpers.js').sortFeedByDate;

const feedFetchTrimmer = function(feedUrl, callback) {
// options for got
Expand Down Expand Up @@ -81,7 +81,7 @@ const feedFetchTrimmer = function(feedUrl, callback) {
});
}
const filename = sanitize(feedUrl) + '.xml';
fs.writeFile(path.resolve(__dirname,'./feeds/', filename), xml, {mode:0o664}, function(err) {
fs.writeFile(path.resolve(__dirname,'../feeds/', filename), xml, {mode:0o664}, function(err) {
if (err) {
console.log('feedFetchTrimmer: ' + feedUrl + ' : ' + err);
}
Expand Down

0 comments on commit ca66d95

Please sign in to comment.