import { sign } from 'electron-osx-sign';
import { PARENT_PLIST_PATH, CHILD_PLIST_PATH, DEV_PROVISIONING_PROFILE } from './config';

const signApp = (appPath, pkgPath) => {
    const resourcesPath = path.join(appPath, './Contents/Resources/');
    const signOpts = {
        app: appPath,
        platform: 'mas',
        binaries: [ /* Here goes the list of binaries you have in your app, like the widevine plugin. */ ],
        entitlements: PARENT_PLIST_PATH,
        'entitlements-inherit': CHILD_PLIST_PATH,
        'provisioning-profile': DEV_PROVISIONING_PROFILE,
        identity: 'Mac Developer: Yoann MOINET (REDACTED)',
        type: 'development',
    };

    sign(signOpts);
};