MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / openZipFile

Method openZipFile

static/panes/tree.ts:581–598  ·  view source on GitHub ↗
(htmlfile)

Source from the content-addressed store, hash-verified

579 }
580
581 private async openZipFile(htmlfile) {
582 if (!htmlfile.name.toLowerCase().endsWith('.zip')) {
583 this.alertSystem.alert('Load project file', 'Projects can only be loaded from .zip files', {isError: true});
584 return;
585 }
586
587 this.multifileService.forEachFile((file: MultifileFile) => {
588 this.removeFile(file.fileId);
589 });
590
591 await this.multifileService.loadProjectFromFile(htmlfile, (file: MultifileFile) => {
592 this.refresh();
593 if (file.filename === 'CMakeLists.txt') {
594 // todo: find a way to toggle on CMake checkbox...
595 this.editFile(file.fileId);
596 }
597 });
598 }
599
600 private async askForOverwriteAndDo(filename): Promise<void> {
601 return new Promise((resolve, reject) => {

Callers 1

initButtonsMethod · 0.95

Calls 6

removeFileMethod · 0.95
refreshMethod · 0.95
editFileMethod · 0.95
alertMethod · 0.80
forEachFileMethod · 0.80
loadProjectFromFileMethod · 0.80

Tested by

no test coverage detected