forked from juice-shop/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 28
/
rsn-verbose.ts
23 lines (22 loc) · 1.07 KB
/
rsn-verbose.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { readFiles, checkDiffs, getDataFromFile, checkData, seePatch } from './rsnUtil'
const colors = require('colors/safe')
const keys = readFiles()
checkDiffs(keys)
.then(data => {
console.log('---------------------------------------')
const fileData = getDataFromFile()
const filesWithDiff = checkData(data, fileData)
if (filesWithDiff.length === 0) {
console.log(`${colors.green.bold('No new file diffs recognized since last lock!')} No action required.`)
} else {
console.log(`${colors.red.bold('New file diffs recognized since last lock!')} Double-check and amend listed files and lock new state with ${colors.bold('npm run rsn:update')}`)
console.log(`Be aware that diffs for the ${filesWithDiff.length} affected files below contain ${colors.bold('all changes')} including locked & cached ones! Compare carefully!`)
console.log('---------------------------------------')
filesWithDiff.forEach(async file => await seePatch(file))
process.exitCode = 1
}
})
.catch(err => {
console.log(err)
process.exitCode = 1
})