forked from electron/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdates.js
More file actions
21 lines (18 loc) · 729 Bytes
/
Copy pathdates.js
File metadata and controls
21 lines (18 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const fs = require('fs')
const path = require('path')
const execSync = require('child_process').execSync
const datesPath = path.join(__dirname, '../meta/dates.json')
const dates = require(datesPath)
const existingSlugs = Object.keys(dates)
const apps = require('../lib/raw-app-list')()
console.log('Checking app submission dates...')
apps
.filter(app => existingSlugs.indexOf(app.slug) === -1)
.forEach(app => {
// https://git-scm.com/docs/pretty-formats
const cmd = `git log -S "${app.website}" --pretty=format:'%ci' | tail -n1`
const date = String(execSync(cmd)).slice(0, 10)
console.log(`${app.slug}: ${date}`)
dates[app.slug] = date
})
fs.writeFileSync(datesPath, JSON.stringify(dates, null, 2))