github-desktop/script/test-setup.ts

30 lines
842 B
TypeScript
Raw Normal View History

2017-10-19 23:04:47 +00:00
/* eslint-disable no-sync */
2017-07-26 19:00:57 +00:00
import * as fs from 'fs'
import * as cp from 'child_process'
import { getLogFiles } from './review-logs'
2017-11-20 01:30:16 +00:00
import { getProductName } from '../app/package-info'
import { getDistPath } from './dist-info'
2017-09-12 12:29:55 +00:00
const isFork = process.env.CIRCLE_PR_USERNAME
2017-09-12 12:29:55 +00:00
if (process.platform === 'darwin' && process.env.CIRCLECI && !isFork) {
2017-09-24 00:01:43 +00:00
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)
}
2017-06-19 15:02:19 +00:00
console.log('\n\n')
}
const output = cp.execSync('git config -l --show-origin', { encoding: 'utf-8' })
2017-06-19 15:02:19 +00:00
console.log(`Git config:\n${output}\n\n`)
// delete existing log files
getLogFiles().forEach(file => {
console.log(`deleting ${file}`)
fs.unlinkSync(file)
})