aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMiroslav Kratochvil <miroslav.kratochvil@uni.lu>2023-10-16 11:37:27 +0200
committerMiroslav Kratochvil <miroslav.kratochvil@uni.lu>2023-10-16 11:37:27 +0200
commitfee144a3eca7e35b998061032f87d1e053999c6d (patch)
tree4475ab5ad29f7ad4acbe875fe791ee1da68e8f5a /scripts
parent4cdbf598c0e343384f8af3421d332ed15d8afe4e (diff)
parent005b69dd472811d7a8e623c3761d476b5584b92c (diff)
downloadreploy-fee144a3eca7e35b998061032f87d1e053999c6d.tar.gz
reploy-fee144a3eca7e35b998061032f87d1e053999c6d.tar.bz2
Merge branch 'mk-howtocards-fixes' into 'master'
updates required for howto-cards See merge request lcsb/sps/reploy!5
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make-search-index.js6
-rwxr-xr-xscripts/source-timestamps.sh10
2 files changed, 8 insertions, 8 deletions
diff --git a/scripts/make-search-index.js b/scripts/make-search-index.js
index f923b54..38ed214 100644
--- a/scripts/make-search-index.js
+++ b/scripts/make-search-index.js
@@ -34,7 +34,7 @@ lunr = require("lunr")
fs = require("fs")
if(process.argv.length !== 5) {
- console.error('Needs exactly 3 arguments (input json, output index).');
+ console.error('Needs exactly 3 arguments (input json, output index, output metadata).');
process.exit(1);
}
@@ -44,7 +44,7 @@ lunr.tokenizer.separator = /(\p{P}|\p{S}|\p{Z}|\p{C})+/u
var idx = lunr(function () {
this.ref('link')
- this.field('title', {boost: 9})
+ this.field('name', {boost: 9})
this.field('tag', {boost: 3})
this.field('text')
@@ -56,5 +56,5 @@ var idx = lunr(function () {
fs.writeFileSync(process.argv[3], JSON.stringify(idx), {encoding: 'utf8'})
fs.writeFileSync(process.argv[4], JSON.stringify(
- Object.fromEntries(documents.map(x => [x.link, {"title": x.title, "tags": x.tags}]))
+ Object.fromEntries(documents.map(x => [x.link, {"name": x.name, "tags": x.tags}]))
), {encoding: 'utf8'})
diff --git a/scripts/source-timestamps.sh b/scripts/source-timestamps.sh
index 5bce4de..ce30cf9 100755
--- a/scripts/source-timestamps.sh
+++ b/scripts/source-timestamps.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Copyright (C) 2023 University of Luxembourg
@@ -30,13 +30,13 @@ do
find "$1" -type f -name '*.md' | grep -v "$NOT_SOURCE_REGEX" | while read file ; do
fn=`basename "$file"`
dir=`dirname "$file"`
- tsfn="$fn.timestamp"
+ outfn="$fn.metadata.yml"
(
- echo "making timestamp in '$dir' for file '$fn' ..." >> "$LOGFILE"
+ echo "adding timestamp in '$dir' for file '$fn' ..." >> "$LOGFILE"
cd "$dir"
- if [ -f "$tsfn" ]
+ if grep -q -s "^timestamp:" "$outfn"
then echo "... but it already exists; skipping!" >> "$LOGFILE"
- else git log -n 1 --pretty=format:%cs -- "$fn" > "$tsfn"
+ else git log -n 1 --pretty=format:$'timestamp: %cs\n' -- "$fn" >> "$outfn"
fi
)
done