Skip to content

Commit ec85c40

Browse files
committed
Add more debug for fix
1 parent 342eeb0 commit ec85c40

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/commands/fix/git.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ export async function gitCreateAndPushBranchIfNeeded(
129129
basename === 'pnpm-lock.yaml'
130130
)
131131
})
132+
debugLog('branch', branch)
133+
debugLog('gitCreateAndPushBranchIfNeeded > moddedFilepaths', moddedFilepaths)
132134
if (moddedFilepaths.length) {
133135
await spawn('git', ['add', ...moddedFilepaths], { cwd })
134136
}
@@ -141,7 +143,9 @@ export async function gitHardReset(cwd = process.cwd()): Promise<void> {
141143
await spawn('git', ['reset', '--hard'], { cwd })
142144
}
143145

144-
async function gitUnstagedModifiedFiles(cwd = process.cwd()): Promise<string[]> {
146+
async function gitUnstagedModifiedFiles(
147+
cwd = process.cwd()
148+
): Promise<string[]> {
145149
const { stdout } = await spawn('git', ['diff', '--name-only'], { cwd })
146150
const rawFiles = stdout?.trim().split('\n') ?? []
147151
return rawFiles.map(relPath => normalizePath(relPath))

src/commands/fix/open-pr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { RequestError } from '@octokit/request-error'
66
import { Octokit } from '@octokit/rest'
77
import { codeBlock } from 'common-tags'
88

9+
import { debugLog } from '@socketsecurity/registry/lib/debug'
910
import { logger } from '@socketsecurity/registry/lib/logger'
1011
import { spawn } from '@socketsecurity/registry/lib/spawn'
1112

@@ -14,7 +15,6 @@ import constants from '../../constants'
1415

1516
import type { components } from '@octokit/openapi-types'
1617
import type { OctokitResponse } from '@octokit/types'
17-
import { debugLog } from '@socketsecurity/registry/lib/debug'
1818

1919
type PullsCreateResponseData = components['schemas']['pull-request']
2020

src/commands/fix/pnpm-fix.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,16 @@ export async function pnpmFix(
337337
errored = true
338338
}
339339

340+
debugLog('check "errored":', errored)
340341
if (!errored && shouldOpenPr) {
342+
debugLog('1: gitCreateAndPushBranchIfNeeded')
341343
// eslint-disable-next-line no-await-in-loop
342344
await gitCreateAndPushBranchIfNeeded(
343345
branch,
344346
getSocketCommitMessage(oldPurl, newVersion, workspaceName),
345347
cwd
346348
)
349+
debugLog('2: openGitHubPullRequest')
347350
// eslint-disable-next-line no-await-in-loop
348351
const prResponse = await openGitHubPullRequest(
349352
owner,

0 commit comments

Comments
 (0)