( $: Shell, directory: string, )
| 122 | * @returns `true` if both the CLI and the `.atomic/` directory are present |
| 123 | */ |
| 124 | export async function isAtomicAvailable( |
| 125 | $: Shell, |
| 126 | directory: string, |
| 127 | ): Promise<boolean> { |
| 128 | try { |
| 129 | const version = await $`${ATOMIC_CMD} --version` |
| 130 | .cwd(directory) |
| 131 | .quiet() |
| 132 | .nothrow(); |
| 133 | |
| 134 | if (version.exitCode !== 0) return false; |
| 135 | |
| 136 | const repo = await $`test -d ${ATOMIC_DIR}` |
| 137 | .cwd(directory) |
| 138 | .quiet() |
| 139 | .nothrow(); |
| 140 | |
| 141 | return repo.exitCode === 0; |
| 142 | } catch { |
| 143 | return false; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // ============================================================================= |
| 148 | // Payload Helpers |
nothing calls this directly
no outgoing calls
no test coverage detected