MCPcopy Index your code
hub / github.com/cloudgraphdev/cli / updateCgNodeFormula

Function updateCgNodeFormula

release/scripts/homebrew.js:165–186  ·  view source on GitHub ↗
(brewDir)

Source from the content-addressed store, hash-verified

163}
164
165async function updateCgNodeFormula(brewDir) {
166 const formulaPath = path.join(brewDir, 'cg-node.rb')
167
168 console.log(`updating CloudGraph-node Formula in ${formulaPath}`)
169 console.log(`getting SHA and URL for Node.js version ${NODE_VERSION}`)
170
171 const { url, sha256 } = await getDownloadInfoForNodeVersion(NODE_VERSION)
172
173 console.log(`done getting SHA for Node.js version ${NODE_VERSION}: ${sha256}`)
174 console.log(`done getting URL for Node.js version ${NODE_VERSION}: ${url}`)
175
176 const templatePath = path.join(TEMPLATES, 'cg-node.rb')
177 const template = fs.readFileSync(templatePath).toString('utf-8')
178
179 const templateReplaced = template
180 .replace('__NODE_BIN_URL__', url)
181 .replace('__NODE_SHA256__', sha256)
182 .replace('__NODE_VERSION__', NODE_VERSION)
183
184 fs.writeFileSync(formulaPath, templateReplaced)
185 console.log(`done updating cg-node Formula in ${formulaPath}`)
186}
187
188async function updateHomebrew() {
189 const tmp = path.join(__dirname, 'tmp')

Callers 1

updateHomebrewFunction · 0.85

Calls 1

Tested by

no test coverage detected