tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
add bump cursor script
awarm.space
6 months ago
e4216a96
6c04c63a
+14
1 changed file
expand all
collapse all
unified
split
appview
bumpCursor.js
+14
appview/bumpCursor.js
···
1
1
+
import { readFileSync, writeFileSync } from "node:fs";
2
2
+
const cursorFile = process.env.CURSOR_FILE || "/cursor/cursor";
3
3
+
let file = readFileSync(cursorFile).toString();
4
4
+
let cursor = parseInt(file);
5
5
+
if (Number.isNaN(cursor)) {
6
6
+
console.log(`invalid cursor: ${cursor}`);
7
7
+
} else {
8
8
+
let newCursor = (cursor + 300 * 60 * 60 * 12).toString();
9
9
+
writeFileSync(cursorFile, (cursor + 300 * 60 * 60 * 12).toString());
10
10
+
console.log(`
11
11
+
old cursor: ${cursor}
12
12
+
new cursor: ${newCursor}
13
13
+
`);
14
14
+
}