🐛 fixes gitCommit + desc
All checks were successful
Update menicka / update-rss (push) Successful in 5m20s

This commit is contained in:
Jan Andrle 2024-07-17 17:01:02 +02:00
parent 65628c1f0d
commit b685634b54
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB
4 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,7 @@
# menicka-cron # menicka-cron
<!-- generated --> <!-- generated -->
Konsolidace obědových meníček pro vybírání obědů v práci.
[pondělí](#pondělí) · [úterý](#úterý) · [středa](#středa) · [čtvrtek](#čtvrtek) · [pátek](#pátek) · [sobota](#sobota) · [neděle](#neděle) [pondělí](#pondělí) · [úterý](#úterý) · [středa](#středa) · [čtvrtek](#čtvrtek) · [pátek](#pátek) · [sobota](#sobota) · [neděle](#neděle)
## pondělí ## pondělí

15
cli.mjs
View File

@ -13,24 +13,23 @@ $.api()
const menicka= await Promise.allSettled([ menickoCukrovarka(), menickoGlobus(), menickoMamafoodbistro() ]) const menicka= await Promise.allSettled([ menickoCukrovarka(), menickoGlobus(), menickoMamafoodbistro() ])
.then(results=> results.filter(p=> p.status!=="rejected").map(p=> p.value)); .then(results=> results.filter(p=> p.status!=="rejected").map(p=> p.value));
const days= [ "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota", "neděle" ]; const days= [ "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota", "neděle" ];
let out= days let out= description+"\n\n";
.map((v)=> `[${v}](#${v})`) out+= days.map((v)=> `[${v}](#${v})`).join(" · "); // anchors for days
.join(" · "); for(const day of days){ // menicka
for(const day of days){
out+= `\n\n## ${day}\n`; out+= `\n\n## ${day}\n`;
out+= menicka.map(dayToMd(day)).join("\n"); out+= menicka.map(dayToMd(day)).join("\n");
} }
const gen= [ "<!-- generated -->", "<!-- /generated -->" ]; const gen= [ "<!-- generated -->", "<!-- /generated -->" ];
const readme= s.cat("README.md"); const target= "README.md";
const readme= s.cat(target);
out= [ out= [
readme.slice(0, readme.indexOf(gen[0])-1), readme.slice(0, readme.indexOf(gen[0])-1),
gen[0], out.replace(/(\*)/g, "\\$1"), gen[1], gen[0], out.replace(/(\*)/g, "\\$1"), gen[1],
readme.slice(readme.indexOf("\n", readme.indexOf(gen[1]))+1) readme.slice(readme.indexOf("\n", readme.indexOf(gen[1]))+1)
].join("\n"); ].join("\n");
s.echo(out).to("README.md"); s.echo(out).to(target);
if(is_git) gitCommit(changed, "pull"); if(is_git) gitCommit([ target ], "pull");
$.exit(0); $.exit(0);
}) })
.parse(); .parse();

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "menicka-cron", "name": "menicka-cron",
"version": "1.0.1", "version": "1.0.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "menicka-cron", "name": "menicka-cron",
"version": "1.0.1", "version": "1.0.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jsdom": "~24.1" "jsdom": "~24.1"

View File

@ -1,7 +1,7 @@
{ {
"name": "menicka-cron", "name": "menicka-cron",
"version": "1.0.1", "version": "1.0.2",
"description": "", "description": "Konsolidace obědových meníček pro vybírání obědů v práci.",
"bin": "cli.mjs", "bin": "cli.mjs",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"