Remove root.js (#10653)
* Replace some path.join() to config.* entries * Remove root.js * Review fix
This commit is contained in:
@@ -5,7 +5,6 @@ const fs = require('fs')
|
||||
const os = require('os')
|
||||
const assert = require('assert')
|
||||
const { spawnSync } = require('child_process')
|
||||
const rootDir = require('./root')
|
||||
|
||||
let npmCommand = 'npm'
|
||||
if (process.platform === 'win32') {
|
||||
@@ -13,6 +12,13 @@ if (process.platform === 'win32') {
|
||||
}
|
||||
let NpmConfig = null
|
||||
|
||||
let dirName = __dirname
|
||||
// Use fs.realpathSync to normalize the path(__dirname could be c:\.. or C:\..).
|
||||
if (process.platform === 'win32') {
|
||||
dirName = fs.realpathSync.native(dirName)
|
||||
}
|
||||
const rootDir = path.resolve(dirName, '..', '..', '..', '..', '..')
|
||||
|
||||
const run = (cmd, args = []) => {
|
||||
const prog = spawnSync(cmd, args)
|
||||
if (prog.status !== 0) {
|
||||
|
||||
@@ -14,11 +14,11 @@ const path = require('path')
|
||||
const fs = require('fs')
|
||||
const chalk = require('chalk')
|
||||
const { JSDOM } = require("jsdom")
|
||||
const rootDir = require('./root')
|
||||
const config = require('./config')
|
||||
|
||||
// Change to `true` for verbose console log output of GRD traversal
|
||||
const verboseLogFindGrd = false
|
||||
const srcDir = path.join(rootDir, 'src')
|
||||
const srcDir = config.srcDir
|
||||
|
||||
// chromium_strings.grd and any of its parts files that we track localization for in transifex
|
||||
// These map to brave/app/resources/chromium_strings*.xtb
|
||||
|
||||
@@ -21,8 +21,7 @@ const deleteFile = (path) => {
|
||||
}
|
||||
|
||||
const getDepotToolsPath = () => {
|
||||
const depotToolsPath =
|
||||
path.join(config.rootDir, 'src/brave/vendor/depot_tools')
|
||||
const depotToolsPath = config.depotToolsDir
|
||||
if (!fs.existsSync(depotToolsPath)) {
|
||||
console.warn('Depot Tools path [' + depotToolsPath + '] doesn\'t exist')
|
||||
return ''
|
||||
@@ -49,7 +48,7 @@ const ensureDepotToolsInPath = (options) => {
|
||||
|
||||
const getDefaultOptions = () => {
|
||||
let options = Object.assign({}, config.defaultOptions)
|
||||
options.cwd = path.join(config.rootDir, 'src/brave')
|
||||
options.cwd = config.braveCoreDir
|
||||
ensureDepotToolsInPath(options)
|
||||
return options
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
let dirName = __dirname
|
||||
|
||||
// Use fs.realpathSync to normalize the path(__dirname could be c:\.. or C:\..).
|
||||
if (process.platform === 'win32') {
|
||||
dirName = fs.realpathSync.native(dirName)
|
||||
}
|
||||
|
||||
module.exports = path.resolve(dirName, '..', '..', '..', '..', '..')
|
||||
Reference in New Issue
Block a user