mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-05 14:30:32 -05:00
Merge branch 'master' into move-deploy-scripts
# Conflicts: # package.json
This commit is contained in:
@@ -1 +1,23 @@
|
||||
const findIndex = require('lodash/findIndex')
|
||||
const path = require('path')
|
||||
|
||||
// if passing the --project or --run-project arg, normalize its value so
|
||||
// that it's relative to the root and not to packages/server
|
||||
const projectArgIndex = findIndex(process.argv, (arg) => {
|
||||
return arg.includes('--project') || arg.includes('--run-project')
|
||||
})
|
||||
if (projectArgIndex > -1) {
|
||||
if (process.argv[projectArgIndex].includes('=')) {
|
||||
// --project=../foo
|
||||
const [arg, projectPath] = process.argv[projectArgIndex].split('=')
|
||||
process.argv[projectArgIndex] = `${arg}=${path.resolve(projectPath)}`
|
||||
} else {
|
||||
// --project ../foo
|
||||
const projectPath = process.argv[projectArgIndex + 1]
|
||||
// make sure it's the path and not another argument flag
|
||||
if (projectPath.substring(0, 2) !== '--') {
|
||||
process.argv[projectArgIndex + 1] = path.resolve(projectPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
require('@packages/server')
|
||||
|
||||
Reference in New Issue
Block a user