Use upper case drives letters in builds for win (#10493)

* Use upper case drives letter in build for win

* Change names

* Review fixes

* clang format

* Use fs.realpathSync.native

* Use config.rootDir
This commit is contained in:
Mikhail
2021-10-22 16:01:07 +07:00
committed by GitHub
parent b15b3ee99d
commit df4bab98a5
2 changed files with 12 additions and 3 deletions
+3 -2
View File
@@ -21,7 +21,8 @@ const deleteFile = (path) => {
}
const getDepotToolsPath = () => {
const depotToolsPath = path.resolve(__dirname, '../../../vendor/depot_tools')
const depotToolsPath =
path.join(config.rootDir, 'src/brave/vendor/depot_tools')
if (!fs.existsSync(depotToolsPath)) {
console.warn('Depot Tools path [' + depotToolsPath + '] doesn\'t exist')
return ''
@@ -48,7 +49,7 @@ const ensureDepotToolsInPath = (options) => {
const getDefaultOptions = () => {
let options = Object.assign({}, config.defaultOptions)
options.cwd = path.resolve(__dirname, '../../..')
options.cwd = path.join(config.rootDir, 'src/brave')
ensureDepotToolsInPath(options)
return options
}
+9 -1
View File
@@ -1,3 +1,11 @@
const path = require('path')
const fs = require('fs')
module.exports = path.resolve(__dirname, '..', '..', '..', '..', '..')
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, '..', '..', '..', '..', '..')