mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-02-07 10:16:16 +00:00
Fix rev-manifest missing, like, half the assets
This commit is contained in:
parent
dad24e1199
commit
6f54e70c6a
@ -2,8 +2,11 @@
|
|||||||
module.exports = exports = ({ id, date }) => `---
|
module.exports = exports = ({ id, date }) => `---
|
||||||
id: "${id}"
|
id: "${id}"
|
||||||
date: "${date.toISOString()}"
|
date: "${date.toISOString()}"
|
||||||
|
title:
|
||||||
|
description:
|
||||||
tags:
|
tags:
|
||||||
- Transgender
|
- Transgender
|
||||||
|
author:
|
||||||
tweets:
|
tweets:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -85,11 +85,6 @@ module.exports = exports = class Manifest {
|
|||||||
mode: 'new',
|
mode: 'new',
|
||||||
};
|
};
|
||||||
|
|
||||||
if (task.nocache) {
|
|
||||||
result.mode = 'silent';
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [ iTime, oTime, cTime, iRev ] = await Promise.all([
|
const [ iTime, oTime, cTime, iRev ] = await Promise.all([
|
||||||
local && this.stat(input),
|
local && this.stat(input),
|
||||||
this.stat(output),
|
this.stat(output),
|
||||||
@ -97,6 +92,12 @@ module.exports = exports = class Manifest {
|
|||||||
local && this.compareBy.inputRev && this.revFile(input),
|
local && this.compareBy.inputRev && this.revFile(input),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (task.nocache) {
|
||||||
|
result.iRev = iRev;
|
||||||
|
result.mode = 'silent';
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if (local && !iTime) throw new Error('Input file does not exist: ' + input);
|
if (local && !iTime) throw new Error('Input file does not exist: ' + input);
|
||||||
|
|
||||||
if (!local && !cTime) {
|
if (!local && !cTime) {
|
||||||
@ -150,7 +151,7 @@ module.exports = exports = class Manifest {
|
|||||||
|
|
||||||
async touch (task, lastSeen = new Date()) {
|
async touch (task, lastSeen = new Date()) {
|
||||||
|
|
||||||
if (task.nocache || task.action.name) return null;
|
if (task.nocache || !task.action.name) return null;
|
||||||
|
|
||||||
const hash = this.hash(task);
|
const hash = this.hash(task);
|
||||||
const { input, output } = task;
|
const { input, output } = task;
|
||||||
|
@ -55,7 +55,7 @@ module.exports = exports = async function process (tasks, cache) {
|
|||||||
if (taskLog && LOG[taskLog[0]]) log.info(...taskLog);
|
if (taskLog && LOG[taskLog[0]]) log.info(...taskLog);
|
||||||
|
|
||||||
if (cache.isProd) {
|
if (cache.isProd) {
|
||||||
fs.writeFile(resolve('dist', status.revPath), result);
|
await fs.writeFile(resolve('dist', status.revPath), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, { concurrency: 1 });
|
}, { concurrency: 1 });
|
||||||
|
@ -28,10 +28,9 @@ exports.everything = function (prod = false) {
|
|||||||
async function fn () {
|
async function fn () {
|
||||||
|
|
||||||
// load a directory scan of the public and post folders
|
// load a directory scan of the public and post folders
|
||||||
const [ PublicFiles, PostFiles, engines ] = await Promise.all([
|
const [ PublicFiles, PostFiles ] = await Promise.all([
|
||||||
loadPublicFiles(),
|
loadPublicFiles(),
|
||||||
loadPostFiles(),
|
loadPostFiles(),
|
||||||
getEngines(prod),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// load data for all the files in that folder
|
// load data for all the files in that folder
|
||||||
@ -51,17 +50,15 @@ exports.everything = function (prod = false) {
|
|||||||
|
|
||||||
const assets = [ ...PostFiles.assets, ...PublicFiles.assets ];
|
const assets = [ ...PostFiles.assets, ...PublicFiles.assets ];
|
||||||
|
|
||||||
// compile all tasks to be completed
|
const [ tasks ] = await Promise.all([
|
||||||
const tasks = await Promise.all([
|
await Promise.all([
|
||||||
PublicFiles.tasks,
|
PublicFiles.tasks,
|
||||||
PostFiles.tasks,
|
PostFiles.tasks,
|
||||||
scss(prod),
|
scss(prod),
|
||||||
scripts(prod),
|
scripts(prod),
|
||||||
svg(prod),
|
svg(prod),
|
||||||
favicon(prod),
|
favicon(prod),
|
||||||
]);
|
]),
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
fs.ensureDir(resolve('dist')),
|
fs.ensureDir(resolve('dist')),
|
||||||
writeIndex('pages.json', pages),
|
writeIndex('pages.json', pages),
|
||||||
writeIndex('posts.json', posts),
|
writeIndex('posts.json', posts),
|
||||||
@ -73,6 +70,7 @@ exports.everything = function (prod = false) {
|
|||||||
await evaluate(tasks.flat(), cache);
|
await evaluate(tasks.flat(), cache);
|
||||||
await cache.save();
|
await cache.save();
|
||||||
|
|
||||||
|
const engines = await getEngines(prod);
|
||||||
const postIndex = await pageWriter(engines, pages, posts, prod);
|
const postIndex = await pageWriter(engines, pages, posts, prod);
|
||||||
await fs.writeFile(resolve('dist/tweets/index.json'), prod ? JSON.stringify(postIndex) : JSON.stringify(postIndex, null, 2));
|
await fs.writeFile(resolve('dist/tweets/index.json'), prod ? JSON.stringify(postIndex) : JSON.stringify(postIndex, null, 2));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user