Download projects/gemini-cli/packages/cli/src/utils/resolvePath.ts from LevelUp2x/adaptai: direct link, hf CLI and curl.
- Browser
- Download file 527 Bytes
-
https://huggingface.co/datasets/LevelUp2x/adaptai/resolve/2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/utils/resolvePath.ts
- Command line
-
hf download hf://datasets/LevelUp2x/adaptai@2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/utils/resolvePath.ts
-
curl -L -o resolvePath.ts https://huggingface.co/datasets/LevelUp2x/adaptai/resolve/2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/utils/resolvePath.ts
527 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import * as os from 'node:os'; | |
| import * as path from 'node:path'; | |
| export function resolvePath(p: string): string { | |
| if (!p) { | |
| return ''; | |
| } | |
| let expandedPath = p; | |
| if (p.toLowerCase().startsWith('%userprofile%')) { | |
| expandedPath = os.homedir() + p.substring('%userprofile%'.length); | |
| } else if (p === '~' || p.startsWith('~/')) { | |
| expandedPath = os.homedir() + p.substring(1); | |
| } | |
| return path.normalize(expandedPath); | |
| } | |