Skip to content

Commit 297ac8f

Browse files
SgtPookiachingbrain
andauthoredAug 30, 2022
fix: check-project uses correct projectDir (#1055)
fixes #1054 Co-authored-by: Alex Potsides <alex@achingbrain.net>
1 parent d1b1371 commit 297ac8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/check-project/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
} from './utils.js'
2323
import semver from 'semver'
2424
import Listr from 'listr'
25+
import yargsParser from 'yargs-parser'
2526

2627
/**
2728
* @param {string} projectDir
@@ -388,7 +389,8 @@ export default new Listr([
388389
{
389390
title: 'check project',
390391
task: async () => {
391-
const projectDir = process.argv[3] || process.cwd()
392+
const argv = yargsParser(process.argv.slice(2))._ // argv = ['check-project', ...]
393+
const projectDir = argv[1]?.toString() ?? process.cwd()
392394
const { branchName, repoUrl } = await getConfig(projectDir)
393395
const manifest = fs.readJSONSync(path.join(projectDir, 'package.json'))
394396
const monorepo = manifest.workspaces != null

0 commit comments

Comments
 (0)
Please sign in to comment.