MCPcopy Create free account
hub / github.com/cloudgraphdev/cli / removeFromLockFile

Method removeFromLockFile

src/manager/index.ts:205–228  ·  view source on GitHub ↗
(plugin: string)

Source from the content-addressed store, hash-verified

203 }
204
205 removeFromLockFile(plugin: string): void {
206 const lockPath = path.join(
207 this.cliConfig.configDir,
208 '.cloud-graph.lock.json'
209 )
210 try {
211 const oldLock = cosmiconfigSync('cloud-graph').load(lockPath)
212 const lockFile = oldLock?.config
213 if (!lockFile || !lockFile[this.pluginType]?.[plugin]) {
214 this.logger.warn(
215 `No lock file found containing ${plugin}, could not remove`
216 )
217 return
218 }
219 delete lockFile[this.pluginType][plugin]
220 this.logger.success(
221 `${this.pluginType} ${chalk.green(plugin)} has been removed`
222 )
223 fs.writeFileSync(lockPath, JSON.stringify(lockFile, null, 2))
224 } catch (error: any) {
225 this.logger.error(`There was an error removing ${plugin} from lock file`)
226 this.logger.debug(error)
227 }
228 }
229
230 writeVersionToLockFile({
231 plugin,

Callers 2

runMethod · 0.80
runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected