mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 16:41:11 -07:00
chore: Extract '.gemini' to GEMINI_DIR constant (#10540)
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7beaa368a9
commit
518caae62e
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as path from 'node:path';
|
||||
import type { Config } from '@google/gemini-cli-core';
|
||||
import { Storage } from '@google/gemini-cli-core';
|
||||
import { GEMINI_DIR, Storage } from '@google/gemini-cli-core';
|
||||
import mock from 'mock-fs';
|
||||
import { FileCommandLoader } from './FileCommandLoader.js';
|
||||
import { assert, vi } from 'vitest';
|
||||
@@ -529,7 +529,9 @@ describe('FileCommandLoader', () => {
|
||||
).getProjectCommandsDir();
|
||||
const extensionDir = path.join(
|
||||
process.cwd(),
|
||||
'.gemini/extensions/test-ext',
|
||||
GEMINI_DIR,
|
||||
'extensions',
|
||||
'test-ext',
|
||||
);
|
||||
|
||||
mock({
|
||||
@@ -582,7 +584,9 @@ describe('FileCommandLoader', () => {
|
||||
).getProjectCommandsDir();
|
||||
const extensionDir = path.join(
|
||||
process.cwd(),
|
||||
'.gemini/extensions/test-ext',
|
||||
GEMINI_DIR,
|
||||
'extensions',
|
||||
'test-ext',
|
||||
);
|
||||
|
||||
mock({
|
||||
@@ -678,11 +682,15 @@ describe('FileCommandLoader', () => {
|
||||
it('only loads commands from active extensions', async () => {
|
||||
const extensionDir1 = path.join(
|
||||
process.cwd(),
|
||||
'.gemini/extensions/active-ext',
|
||||
GEMINI_DIR,
|
||||
'extensions',
|
||||
'active-ext',
|
||||
);
|
||||
const extensionDir2 = path.join(
|
||||
process.cwd(),
|
||||
'.gemini/extensions/inactive-ext',
|
||||
GEMINI_DIR,
|
||||
'extensions',
|
||||
'inactive-ext',
|
||||
);
|
||||
|
||||
mock({
|
||||
@@ -737,7 +745,9 @@ describe('FileCommandLoader', () => {
|
||||
it('handles missing extension commands directory gracefully', async () => {
|
||||
const extensionDir = path.join(
|
||||
process.cwd(),
|
||||
'.gemini/extensions/no-commands',
|
||||
GEMINI_DIR,
|
||||
'extensions',
|
||||
'no-commands',
|
||||
);
|
||||
|
||||
mock({
|
||||
@@ -769,7 +779,12 @@ describe('FileCommandLoader', () => {
|
||||
});
|
||||
|
||||
it('handles nested command structure in extensions', async () => {
|
||||
const extensionDir = path.join(process.cwd(), '.gemini/extensions/a');
|
||||
const extensionDir = path.join(
|
||||
process.cwd(),
|
||||
GEMINI_DIR,
|
||||
'extensions',
|
||||
'a',
|
||||
);
|
||||
|
||||
mock({
|
||||
[extensionDir]: {
|
||||
|
||||
Reference in New Issue
Block a user