Download src/utils/settings/managedPath.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/chenbhao/codev/resolve/714ab7d15ffd78992a4c3d4e2bf153c2f62f4841/src/utils/settings/managedPath.ts
- Command line
-
hf download hf://chenbhao/codev@714ab7d15ffd78992a4c3d4e2bf153c2f62f4841/src/utils/settings/managedPath.ts
-
curl -L -o managedPath.ts https://huggingface.co/chenbhao/codev/resolve/714ab7d15ffd78992a4c3d4e2bf153c2f62f4841/src/utils/settings/managedPath.ts
1.1 kB
| import memoize from 'lodash-es/memoize.js' | |
| import { join } from 'path' | |
| import { getPlatform } from '../platform.js' | |
| /** | |
| * Get the path to the managed settings directory based on the current platform. | |
| */ | |
| export const getManagedFilePath = memoize(function (): string { | |
| // Allow override for testing/demos (Ant-only, eliminated from external builds) | |
| if ( | |
| process.env.USER_TYPE === 'ant' && | |
| process.env.CLAUDE_CODE_MANAGED_SETTINGS_PATH | |
| ) { | |
| return process.env.CLAUDE_CODE_MANAGED_SETTINGS_PATH | |
| } | |
| switch (getPlatform()) { | |
| case 'macos': | |
| return '/Library/Application Support/ClaudeCode' | |
| case 'windows': | |
| return 'C:\\Program Files\\ClaudeCode' | |
| default: | |
| return '/etc/claude-code' | |
| } | |
| }) | |
| /** | |
| * Get the path to the managed-settings.d/ drop-in directory. | |
| * managed-settings.json is merged first (base), then files in this directory | |
| * are merged alphabetically on top (drop-ins override base, later files win). | |
| */ | |
| export const getManagedSettingsDropInDir = memoize(function (): string { | |
| return join(getManagedFilePath(), 'managed-settings.d') | |
| }) | |