build: allow getOutDir cli argument (#21545)

This commit is contained in:
Shelley Vohr 2019-12-17 14:00:42 -08:00 committed by GitHub
parent 54b4756a29
commit f0d52eaf0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 8 deletions

View file

@ -1,12 +1,19 @@
/*
Usage:
$ node ./script/gn-check.js [--outDir=dirName]
*/
const cp = require('child_process')
const path = require('path')
const args = require('minimist')(process.argv.slice(2), { string: ['outDir'] })
const { getOutDir } = require('./lib/utils')
const SOURCE_ROOT = path.normalize(path.dirname(__dirname))
const DEPOT_TOOLS = path.resolve(SOURCE_ROOT, '..', 'third_party', 'depot_tools')
const OUT_DIR = getOutDir()
const OUT_DIR = getOutDir({ outDir: args.outDir })
if (!OUT_DIR) {
throw new Error(`No viable out dir: one of Debug, Testing, or Release must exist.`)
}