mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-02 04:50:06 -05:00
scripts: normalize project path to be relative to root for npm start
This commit is contained in:
@@ -1 +1,15 @@
|
||||
const findIndex = require('lodash/findIndex')
|
||||
const path = require('path')
|
||||
|
||||
// if passing the --project arg, normalize its value so that it's
|
||||
// relative to the root and not to packages/server
|
||||
const projectArgIndex = findIndex(process.argv, (arg) => arg === '--project')
|
||||
if (projectArgIndex > -1) {
|
||||
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