зеркало из https://github.com/github/docs.git
Remove use of commander from release script rather than adding it as a required production dependency (#17215)
This commit is contained in:
Родитель
4e6c273e74
Коммит
72140bb8bb
|
@ -8,7 +8,6 @@
|
|||
//
|
||||
// [end-readme]
|
||||
|
||||
const program = require('commander')
|
||||
const Redis = require('ioredis')
|
||||
|
||||
const { REDIS_URL, HEROKU_RELEASE_VERSION, HEROKU_PRODUCTION_APP } = process.env
|
||||
|
@ -21,12 +20,8 @@ const startTime = Date.now()
|
|||
const expirationDuration = 30 * 60 * 1000 // 30 minutes
|
||||
const expirationTimestamp = startTime + expirationDuration // 30 minutes from now
|
||||
|
||||
program
|
||||
.description('Purge the Redis rendered page cache')
|
||||
.option('-d, --dry-run', 'print keys to be purged without actually purging')
|
||||
.parse(process.argv)
|
||||
|
||||
const dryRun = program.dryRun
|
||||
// print keys to be purged without actually purging
|
||||
const dryRun = ['-d', '--dry-run'].includes(process.argv[2])
|
||||
|
||||
// verify environment variables
|
||||
if (!REDIS_URL) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче