Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function build(): Promise<{ packageFile: string }> {
const packager = new Packager({
targets: Platform.LINUX.createTarget("snap"),
config: await getConfig(
CWD,
path.join(CWD, "./electron-builder.yml"),
null,
),
});
const {artifactPaths: [packageFile]} = await packager.build();
if (!String(packageFile).endsWith(".snap")) {
throw new Error(`Invalid artifact: "${packageFile}"`);
}
return {packageFile};
}
async function build(): Promise<{ packageFile: string }> {
const packager = new Packager({
targets: Platform.LINUX.createTarget("appimage"),
config: await getConfig(
CWD,
path.join(CWD, "./electron-builder.yml"),
null,
),
});
const {artifactPaths: [packageFile]} = await packager.build();
if (!String(packageFile).endsWith(".AppImage")) {
throw new Error(`Invalid artifact: "${packageFile}"`);
}
return {packageFile};
}
export function build(rawOptions?: CliOptions): Promise> {
const buildOptions = normalizeOptions(rawOptions || {})
return _build(buildOptions, new Packager(buildOptions))
}