<commit_before>// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db

const fs = require('fs')
const path = require('path')
// eslint-disable-next-line node/no-unpublished-require
const electron_notarize = require('electron-notarize')

module.exports = async function(params) {
  // Only notarize the app on Mac OS only.
  if (process.platform !== 'darwin') {
    return
  }
  // eslint-disable-next-line no-console
  console.log('afterSign hook triggered', params)

  // Same appId in electron-builder.
  const appId = 'io.cozy.desktop'

  const appPath = path.join(
    params.appOutDir,
    `${params.packager.appInfo.productFilename}.app`
  )
  if (!fs.existsSync(appPath)) {
    throw new Error(`Cannot find application at: ${appPath}`)
  }

  // eslint-disable-next-line no-console
  console.log(`Notarizing ${appId} found at ${appPath}`)

  try {
    await electron_notarize.notarize({
      appBundleId: appId,
      appPath: appPath,
      appleId: process.env.appleId,
      appleIdPassword: <PASSWORD>
    })
  } catch (error) {
    // eslint-disable-next-line no-console
    console.error(error)
  }

  // eslint-disable-next-line no-console
  console.log(`Done notarizing ${appId}`)
}<commit_msg>ci: Change Apple ID env variables syntax<commit_after>// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db

const fs = require('fs')
const path = require('path')
// eslint-disable-next-line node/no-unpublished-require
const electron_notarize = require('electron-notarize')

module.exports = async function(params) {
  // Only notarize the app on Mac OS only.
  if (process.platform !== 'darwin') {
    return
  }
  // eslint-disable-next-line no-console
  console.log('afterSign hook triggered', params)

  // Same appId in electron-builder.
  const appId = 'io.cozy.desktop'

  const appPath = path.join(
    params.appOutDir,
    `${params.packager.appInfo.productFilename}.app`
  )
  if (!fs.existsSync(appPath)) {
    throw new Error(`Cannot find application at: ${appPath}`)
  }

  // eslint-disable-next-line no-console
  console.log(`Notarizing ${appId} found at ${appPath}`)

  try {
    await electron_notarize.notarize({
      appBundleId: appId,
      appPath: appPath,
      appleId: process.env.APPLE_ID,
      appleIdPassword: <PASSWORD>
    })
  } catch (error) {
    // eslint-disable-next-line no-console
    console.error(error)
  }

  // eslint-disable-next-line no-console
  console.log(`Done notarizing ${appId}`)
}
{'fraction_non_alphanumeric': 0.1383572567783094, 'fraction_numerical': 0.006379585326953748, 'mean_word_length': 3.488372093023256, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2060662', 'n_tokens_mistral': 864, 'n_tokens_neox': 836, 'n_words': 174}