MCPcopy Create free account
hub / github.com/xpf0000/FlyEnv / fetchStatic

Method fetchStatic

src/render/core/Module/Module.ts:242–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240 }
241
242 fetchStatic() {
243 if (this.staticFetching) {
244 return
245 }
246 this.staticFetching = true
247 fetchVerion(this.typeFlag)
248 .then((res: any) => {
249 console.log('fetchVerion res: ', res)
250 for (const item of res) {
251 const find = this.static.find(
252 (d) => d.url === item.url && d.version === item.version && d.bin === item.bin
253 )
254 if (!find) {
255 const findDowing = this.staticDowing.find(
256 (d) => d.url === item.url && d.version === item.version && d.bin === item.bin
257 )
258 if (findDowing) {
259 this.static.push(findDowing)
260 } else {
261 const obj = reactive(new ModuleStaticItem(item))
262 obj.typeFlag = this.typeFlag
263 obj.fetchCommand = obj.fetchCommand.bind(obj)
264 obj.copyCommand = obj.copyCommand.bind(obj)
265 obj.runCommand = obj.runCommand.bind(obj)
266 this.static.push(obj)
267 }
268 } else {
269 console.log('find: ', find, item)
270 const downing = find?.downing ?? false
271 Object.assign(find, item)
272 find.downing = downing
273 }
274 }
275 this.staticFetching = false
276 })
277 .catch(() => {
278 this.staticFetching = false
279 })
280 }
281
282 fetchSdkman() {
283 if (this.sdkmanFetching) {

Callers 1

fetchDataFunction · 0.80

Calls 5

fetchVerionFunction · 0.90
catchMethod · 0.80
pushMethod · 0.80
thenMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected