File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { pathToFileURL } from 'node:url'
66import { messageWithCauses , stackWithCauses } from 'pony-cause'
77import updateNotifier from 'tiny-updater'
88
9+ import { debugLog } from '@socketsecurity/registry/lib/debug'
910import { logger } from '@socketsecurity/registry/lib/logger'
1011
1112import { cmdAnalytics } from './commands/analytics/cmd-analytics'
@@ -107,9 +108,10 @@ void (async () => {
107108 } else {
108109 errorTitle = 'Unexpected error with no details'
109110 }
111+ logger . error ( '\n' ) // Any-spinner-newline
110112 logger . fail ( failMsgWithBadge ( errorTitle , errorMessage ) )
111113 if ( errorBody ) {
112- logger . error ( `\n ${ errorBody } `)
114+ debugLog ( ` ${ errorBody } `)
113115 }
114116 await captureException ( e )
115117 }
Original file line number Diff line number Diff line change @@ -161,24 +161,28 @@ async function run(
161161 } )
162162
163163 const {
164+ branch : branchName = '' ,
164165 cwd : cwdOverride ,
165166 defaultBranch,
166167 dryRun,
167168 json,
168169 markdown,
169170 pendingHead,
170171 readOnly,
172+ repo : repoName = '' ,
171173 report,
172174 tmp
173175 } = cli . flags as {
176+ branch : string
174177 cwd : string
178+ defaultBranch : boolean
175179 dryRun : boolean
176- report : boolean
177180 json : boolean
178181 markdown : boolean
179- defaultBranch : boolean
180182 pendingHead : boolean
181183 readOnly : boolean
184+ repo : string
185+ report : boolean
182186 tmp : boolean
183187 }
184188 const defaultOrgSlug = getConfigValue ( 'defaultOrg' )
@@ -189,10 +193,6 @@ async function run(
189193 cwdOverride && cwdOverride !== 'process.cwd()'
190194 ? String ( cwdOverride )
191195 : process . cwd ( )
192- const { branch : branchName = '' , repo : repoName = '' } = cli . flags as {
193- branch : string
194- repo : string
195- }
196196
197197 // We're going to need an api token to suggest data because those suggestions
198198 // must come from data we already know. Don't error on missing api token yet.
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ function ignorePatternToMinimatch(pattern: string): string {
172172
173173function pathsToPatterns ( paths : string [ ] | readonly string [ ] ) : string [ ] {
174174 // TODO: Does not support `~/` paths.
175- return paths . map ( p => ( p === '.' ? '**/*' : p ) )
175+ return paths . map ( p => ( p === '.' || p === './' ? '**/*' : p ) )
176176}
177177
178178export function findBinPathDetailsSync ( binName : string ) : {
@@ -262,9 +262,11 @@ export async function getPackageFilesForScan(
262262 // Lazily access constants.spinner.
263263 const { spinner } = constants
264264
265+ const pats = pathsToPatterns ( inputPaths )
266+
265267 spinner . start ( 'Searching for local files to include in scan...' )
266268
267- const entries = await globWithGitIgnore ( pathsToPatterns ( inputPaths ) , {
269+ const entries = await globWithGitIgnore ( pats , {
268270 cwd,
269271 socketConfig : config
270272 } )
You can’t perform that action at this time.
0 commit comments