Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { join } from 'path';
import { existsSync } from 'fs';
import { getEnvs } from '@/utils/com';
import { detectDefaultShell, detectInteractiveShellProgram, generateExportCommand } from '@/utils/env';

type ShellKind = 'sh' | 'cmd' | 'powershell';
import { ShellKind } from '@/types/common';

interface ExportOptions {
verbose?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type ShellKind = 'sh' | 'cmd' | 'powershell';
export type ShellKind = 'sh' | 'bash' | 'zsh' | 'fish' | 'cmd' | 'powershell';
export type EnvMap = Record<string, string>;
2 changes: 1 addition & 1 deletion src/utils/env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export async function unsetEnv(key: string | string[]): Promise<void> {
/**
* 检测默认shell
*/
export function detectDefaultShell(): string {
export function detectDefaultShell(): ShellKind {
const shell = process.env.SHELL || process.env.COMSPEC || 'sh';

if (shell.includes('bash')) return 'bash';
Expand Down
Loading