@@ -5,7 +5,7 @@ import { arrayUnique } from '@socketsecurity/registry/lib/arrays'
55import { logger } from '@socketsecurity/registry/lib/logger'
66
77import { handlePatch } from './handle-patch.mts'
8- import constants from '../../constants.mts'
8+ import constants , { DOT_SOCKET , MANIFEST_JSON } from '../../constants.mts'
99import { commonFlags , outputFlags } from '../../flags.mts'
1010import { checkCommandInput } from '../../utils/check-input.mts'
1111import { cmdFlagValueToArray } from '../../utils/cmd.mts'
@@ -97,15 +97,16 @@ async function run(
9797 // If given path is absolute then cwd should not affect it.
9898 cwd = path . resolve ( process . cwd ( ) , cwd )
9999
100- const dotSocketDirPath = path . join ( cwd , '.socket' )
100+ const dotSocketDirPath = path . join ( cwd , DOT_SOCKET )
101101 if ( ! existsSync ( dotSocketDirPath ) ) {
102- logger . error ( ' Error: No .socket directory found in current directory' )
102+ logger . error ( ` Error: No ${ DOT_SOCKET } directory found in current directory` )
103103 return
104104 }
105105
106- const manifestPath = path . join ( dotSocketDirPath , 'manifest.json' )
106+ const manifestPath = path . join ( dotSocketDirPath , MANIFEST_JSON )
107107 if ( ! existsSync ( manifestPath ) ) {
108- logger . error ( 'Error: No manifest.json found in .socket directory' )
108+ logger . error ( `Error: No ${ MANIFEST_JSON } found in ${ DOT_SOCKET } directory` )
109+ return
109110 }
110111
111112 const { spinner } = constants
0 commit comments