mergeSliceToMain now runs git reset --hard if git merge --squash fails, restoring a clean working tree instead of leaving conflict markers. The merge guard catch block in auto.ts now: 1. Detects leftover conflicted state (UU/AA/UD in porcelain status) 2. Resets the working tree if conflicts remain 3. Stops auto-mode with a clear error instead of continuing with corrupted .gsd/ state files that cause an infinite dispatch loop Also fixes conflict markers in loader.ts, logo.ts, and postinstall.js that were baked into main from a prior bad merge resolution.
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
/**
|
|
* Shared GSD block-letter ASCII logo.
|
|
*
|
|
* Single source of truth — imported by:
|
|
* - scripts/postinstall.js (via dist/logo.js)
|
|
* - src/loader.ts (via ./logo.js)
|
|
*/
|
|
|
|
/** Raw logo lines — no ANSI codes, no leading newline. */
|
|
export const GSD_LOGO: readonly string[] = [
|
|
' ██████╗ ███████╗██████╗ ',
|
|
' ██╔════╝ ██╔════╝██╔══██╗',
|
|
' ██║ ███╗███████╗██║ ██║',
|
|
' ██║ ██║╚════██║██║ ██║',
|
|
' ╚██████╔╝███████║██████╔╝',
|
|
' ╚═════╝ ╚══════╝╚═════╝ ',
|
|
]
|
|
|
|
/**
|
|
* Render the logo block with a color function applied to each line.
|
|
*
|
|
* @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or picocolors.cyan
|
|
* @returns Ready-to-write string with leading/trailing newlines.
|
|
*/
|
|
export function renderLogo(color: (s: string) => string): string {
|
|
return '\n' + GSD_LOGO.map(color).join('\n') + '\n'
|
|
}
|