Put scan steps into single method

This commit is contained in:
Sam Carlton 2022-08-07 14:19:40 -05:00
parent 50e707a4ac
commit f82e47c4b6

View file

@ -7,7 +7,6 @@ import { isString, isNonEmptyString } from '~/helpers/check-types.js'
import { parsePlistBuffer } from '~/helpers/scanner/parsers/plist.js' import { parsePlistBuffer } from '~/helpers/scanner/parsers/plist.js'
import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js' import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js'
// https://gildas-lormeau.github.io/zip.js/core-api.html#configuration // https://gildas-lormeau.github.io/zip.js/core-api.html#configuration
zip.configure({ zip.configure({
// Disable Web Workers for SSR since Node doesn't support them yet // Disable Web Workers for SSR since Node doesn't support them yet
@ -383,8 +382,7 @@ export class AppScan {
this.binarySupportsNative = this.classifyBinaryEntryArchitecture( this.machoMeta ) this.binarySupportsNative = this.classifyBinaryEntryArchitecture( this.machoMeta )
} }
async start () { async runScan () {
try {
// Load in the file // Load in the file
this.sendMessage({ this.sendMessage({
message: '🚛 Loading file...', message: '🚛 Loading file...',
@ -418,6 +416,13 @@ export class AppScan {
message: '🏁 Scan complete! ', message: '🏁 Scan complete! ',
status: 'complete' status: 'complete'
}) })
}
async start () {
try {
await this.runScan()
} catch ( error ) { } catch ( error ) {
this.sendMessage({ this.sendMessage({
@ -426,5 +431,6 @@ export class AppScan {
error error
}) })
} }
} }
} }