Skip to content

Commit 0e6f2bd

Browse files
author
lucifer
committed
feat: go
1 parent b1d693a commit 0e6f2bd

File tree

4 files changed

+292
-5
lines changed

4 files changed

+292
-5
lines changed

Diff for: .github/workflows/schedule.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: daily
22
on:
3-
push:
43
# Run workflow automatically
54
schedule:
65
# Runs every day 16:00 北京时间 24:00

Diff for: static/my/solutions.json

+1-1
Large diffs are not rendered by default.

Diff for: static/solution/generate.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require("fs");
22

33
const { encrypt } = require("../../utils/crypto.js");
44

5-
const solutions = {};
5+
const solutions = require("./solutions.json");
66

77
function toArray(sep = "-", txt) {
88
if (!txt) return txt;
@@ -40,7 +40,7 @@ function matchWioutPaddingLine(reg, txt) {
4040

4141
// 基础篇
4242
Array.from({ length: 28 }, (_, i) => i + 1).forEach((i) => {
43-
solutions[i] = {};
43+
solutions[i] = solutions[i] || {};
4444
const rawMDBuffer = fs.readFileSync(`../../91alg-4/solution/basic/d${i}.md`);
4545
const rawMD = rawMDBuffer.toString();
4646
const regs = {
@@ -55,6 +55,7 @@ Array.from({ length: 28 }, (_, i) => i + 1).forEach((i) => {
5555
const title = matchWioutPaddingLine(regs.title, rawMD);
5656
const whys = matchWioutPaddingLine(regs.whys, rawMD);
5757
solutions[i] = {
58+
...solutions[i],
5859
day: i,
5960
pres: toArray("-", pres),
6061
tags: toArray("-", tags),

Diff for: static/solution/solutions.json

+288-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)