fix(cli): default session root in shipped config

This commit is contained in:
Turtle
2026-07-30 10:24:04 +08:00
parent 5111a292b4
commit 83360c3dca
7 changed files with 3 additions and 90 deletions
-11
View File
@@ -4,12 +4,10 @@ import { describe, expect, it } from 'vitest'
import {
DEFAULT_DSH_HOME_DISPLAY,
DSH_HOME_DIR_NAME,
SESSIONS_DIR_NAME,
defaultDshHome,
dshHomeDisplay,
expandHomePath,
resolveDshHome,
resolveSessionsRoot,
} from '@deepseek-ai/dsh-paths'
describe('dsh path helpers', () => {
@@ -40,15 +38,6 @@ describe('dsh path helpers', () => {
expect(resolveDshHome(undefined, { DSH_HOME: ' ' })).toBe(defaultDshHome())
})
it('resolves the session store under the home it was given, by the same precedence', () => {
expect(SESSIONS_DIR_NAME).toBe('sessions')
expect(resolveSessionsRoot('/tmp/explicit-dsh', { DSH_HOME: '~/env-dsh' }))
.toBe(join(resolve('/tmp/explicit-dsh'), 'sessions'))
expect(resolveSessionsRoot(undefined, { DSH_HOME: '~/env-dsh' }))
.toBe(join(homedir(), 'env-dsh', 'sessions'))
expect(resolveSessionsRoot(undefined, {})).toBe(join(defaultDshHome(), 'sessions'))
})
it('labels a resolved home by whether it is the default root', () => {
expect(dshHomeDisplay(resolve(defaultDshHome()))).toBe('~/.dsh')
expect(dshHomeDisplay('/some/other/root')).toBe('$DSH_HOME')