MCPcopy
hub / github.com/oslook/cursor-ai-downloads / readVersionHistory

Function readVersionHistory

src/update-cursor-links.ts:152–166  ·  view source on GitHub ↗

* Read version history from JSON file

()

Source from the content-addressed store, hash-verified

150 * Read version history from JSON file
151 */
152function readVersionHistory(): VersionHistory {
153 const historyPath = path.join(process.cwd(), 'version-history.json');
154 if (fs.existsSync(historyPath)) {
155 try {
156 const jsonData = fs.readFileSync(historyPath, 'utf8');
157 return JSON.parse(jsonData) as VersionHistory;
158 } catch (error) {
159 console.error('Error reading version history:', error instanceof Error ? error.message : 'Unknown error');
160 return { versions: [] };
161 }
162 } else {
163 console.log('version-history.json not found, creating a new file');
164 return { versions: [] };
165 }
166}
167
168/**
169 * Save version history to JSON file

Callers 2

updateReadmeFunction · 0.70
updateVersionHistoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected