a tool for shared writing and social publishing

add bump cursor script

+14
+14
appview/bumpCursor.js
··· 1 + import { readFileSync, writeFileSync } from "node:fs"; 2 + const cursorFile = process.env.CURSOR_FILE || "/cursor/cursor"; 3 + let file = readFileSync(cursorFile).toString(); 4 + let cursor = parseInt(file); 5 + if (Number.isNaN(cursor)) { 6 + console.log(`invalid cursor: ${cursor}`); 7 + } else { 8 + let newCursor = (cursor + 300 * 60 * 60 * 12).toString(); 9 + writeFileSync(cursorFile, (cursor + 300 * 60 * 60 * 12).toString()); 10 + console.log(` 11 + old cursor: ${cursor} 12 + new cursor: ${newCursor} 13 + `); 14 + }