Remove root.js (#10653)

* Replace some path.join() to config.* entries

* Remove root.js

* Review fix
This commit is contained in:
Mikhail
2021-10-27 13:19:22 +07:00
committed by GitHub
parent e6b31b1af5
commit fb548e0bd0
4 changed files with 11 additions and 17 deletions
+7 -1
View File
@@ -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) {
+2 -2
View File
@@ -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
+2 -3
View File
@@ -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
}
-11
View File
@@ -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, '..', '..', '..', '..', '..')