Skip to content

Commit

Permalink
Merge branch 'master' into angularfire2-v5-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-bynd committed Oct 24, 2017
2 parents 8a64e8f + b209c27 commit 9b1719c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 114 deletions.
3 changes: 2 additions & 1 deletion .firebaserc
@@ -1,6 +1,7 @@
{
"projects": {
"default": "fir-cms-76f54",
"cm": "fir-cms-76f54"
"cm": "fir-cms-76f54",
"cms": "fir-cms-76f54"
}
}
104 changes: 0 additions & 104 deletions firebase-debug.log

This file was deleted.

18 changes: 9 additions & 9 deletions scripts/static-generator.js
Expand Up @@ -5,11 +5,11 @@ const Nightmare = require('nightmare'),
selector = 'html';

let links = [
'http://localhost:4200/',
'http://localhost:4200/blog',
'http://localhost:4200/products',
'http://localhost:4200/search',
'http://localhost:4200/cart'];
'https://fir-cms-76f54.firebaseapp.com/',
'https://fir-cms-76f54.firebaseapp.com/blog',
'https://fir-cms-76f54.firebaseapp.com/products',
'https://fir-cms-76f54.firebaseapp.com/search',
'https://fir-cms-76f54.firebaseapp.com/cart'];

let getLinks = (i) => {
let nightmareLink = Nightmare({
Expand All @@ -29,8 +29,8 @@ let getLinks = (i) => {
let $ = cheerio.load(content);
let thelinks = $('a');
$(thelinks).each((i, link) => {
if (links.indexOf('http://localhost:4200' + $(link).attr('href')) === -1) {
links.push('http://localhost:4200' + $(link).attr('href'));
if (links.indexOf('https://fir-cms-76f54.firebaseapp.com' + $(link).attr('href')) === -1) {
links.push('https://fir-cms-76f54.firebaseapp.com' + $(link).attr('href'));
}
});

Expand Down Expand Up @@ -67,7 +67,7 @@ let scrape = () => {
});
stream = fs.createWriteStream("./static/index.html");
} else {
let path = './static' + links[x].replace('http://localhost:4200', '');
let path = './static' + links[x].replace('https://fir-cms-76f54.firebaseapp.com', '');
path = path.split('/');
path = path.slice(0, -1);
path = path.join('/');
Expand All @@ -76,7 +76,7 @@ let scrape = () => {
if (err) console.error('dir not created ' + path)
else console.log('dir created ' + path)
});
stream = fs.createWriteStream("./static" + links[x].replace('http://localhost:4200', '') + ".html");
stream = fs.createWriteStream("./static" + links[x].replace('https://fir-cms-76f54.firebaseapp.com', '') + ".html");
}
stream.once('open', (fd) => {
stream.write(content);
Expand Down

0 comments on commit 9b1719c

Please sign in to comment.