mirror of
https://gitlab.com/octospacc/octospacc.gitlab.io
synced 2025-06-05 21:59:15 +02:00
Fix READMEs build
This commit is contained in:
4
Build.sh
4
Build.sh
@@ -1,4 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -x
|
||||||
|
|
||||||
SourceApps="$(ls ./source/)"
|
SourceApps="$(ls ./source/)"
|
||||||
HubSdkApps="${SourceApps} MatrixStickerHelper"
|
HubSdkApps="${SourceApps} MatrixStickerHelper"
|
||||||
HtmlHeadInject='<script src="../../shared/OctoHub-Global.js"></script>'
|
HtmlHeadInject='<script src="../../shared/OctoHub-Global.js"></script>'
|
||||||
@@ -71,5 +73,5 @@ do
|
|||||||
htmltitle='<title>'"${name}"'</title>'
|
htmltitle='<title>'"${name}"'</title>'
|
||||||
htmlcanonical='<link rel="canonical" href="'"${url}"'"/>'
|
htmlcanonical='<link rel="canonical" href="'"${url}"'"/>'
|
||||||
sed -i 's|</head>|<link rel="manifest" href="./WebManifest.json"/>'"${htmltitle}${htmlcanonical}${htmlmanifest}${HtmlHeadInject}"'</head>|' "${htmlfile}"
|
sed -i 's|</head>|<link rel="manifest" href="./WebManifest.json"/>'"${htmltitle}${htmlcanonical}${htmlmanifest}${HtmlHeadInject}"'</head>|' "${htmlfile}"
|
||||||
node ../TranscludeReadmes.js "./${App}"
|
node ../TranscludeReadmes.js "${App}"
|
||||||
done
|
done
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const dir = require('process').argv.slice(-1)[0];
|
const app = require('process').argv.slice(-1)[0];
|
||||||
const readme = `${dir}/README.md`;
|
const readme = `../source/${app}/README.md`;
|
||||||
if (fs.existsSync(readme)) {
|
if (fs.existsSync(readme)) {
|
||||||
let index;
|
let index;
|
||||||
for (const ext of ['js', 'html']) {
|
for (const ext of ['js', 'html']) {
|
||||||
const path = `${dir}/index.${ext}`;
|
const path = `./${app}/index.${ext}`;
|
||||||
if (fs.existsSync(path)) {
|
if (fs.existsSync(path)) {
|
||||||
index = path;
|
index = path;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user