Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async prepareAndBuildSnap (snapDir) {
const snapMetaDir = path.join(snapDir, 'snap')
const snapGuiDir = path.join(snapMetaDir, 'gui')
await fs.ensureDir(snapGuiDir)
await updateSandboxHelperPermissions(this.packageDir)
await createDesktopFile(snapGuiDir, this.config)
await copyIcon(snapGuiDir, this.config)
await copyLauncher(snapDir, this.config)
await createYamlFromTemplate(snapDir, this.packageDir, this.config)
await copyHooks(snapMetaDir, this.config)
await this.snapcraft.run(snapDir, 'snap', this.snapcraftOptions)
return this.snapDestPath
}