1
0
mirror of https://github.com/desktop/desktop synced 2024-07-05 00:58:57 +00:00
github-desktop/script/test-setup.ts
2017-11-20 12:30:16 +11:00

30 lines
842 B
TypeScript

/* eslint-disable no-sync */
import * as fs from 'fs'
import * as cp from 'child_process'
import { getLogFiles } from './review-logs'
import { getProductName } from '../app/package-info'
import { getDistPath } from './dist-info'
const isFork = process.env.CIRCLE_PR_USERNAME
if (process.platform === 'darwin' && process.env.CIRCLECI && !isFork) {
const archive = `${getDistPath()}/${getProductName()}.app`
try {
console.log('validating signature of Desktop app')
cp.execSync(`codesign -dv --verbose=4 '${archive}'`)
} catch (err) {
process.exit(1)
}
console.log('\n\n')
}
const output = cp.execSync('git config -l --show-origin', { encoding: 'utf-8' })
console.log(`Git config:\n${output}\n\n`)
// delete existing log files
getLogFiles().forEach(file => {
console.log(`deleting ${file}`)
fs.unlinkSync(file)
})