MCPcopy Create free account
hub / github.com/electric-sql/electric / main

Function main

scripts/patch_api_spec_version.js:40–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40function main() {
41 // Get the file path from command line arguments
42 const filePath = process.argv[2]
43
44 if (!filePath) {
45 console.error(`Error: Please provide a file path`)
46
47 process.exit(1)
48 }
49
50 try {
51 // Read the file
52 const content = fs.readFileSync(filePath, `utf8`)
53
54 // Replace placeholders
55 const updatedContent = replaceVersionPlaceholders(content)
56
57 // Write the updated content back to the file
58 fs.writeFileSync(filePath, updatedContent)
59
60 console.log(`Successfully updated version placeholders in ${filePath}`)
61 } catch (error) {
62 console.error(`Error processing file: ${error.message}`)
63 process.exit(1)
64 }
65}
66
67// Execute the main function
68main()

Callers 1

Calls 2

errorMethod · 0.45

Tested by

no test coverage detected