Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor, fix circular between constant and global-config legacy components #9470

Merged
merged 1 commit into from
Jan 16, 2025
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
1 change: 0 additions & 1 deletion components/legacy/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ export const BITMAP_PREFIX_MESSAGE = `/**
*/
export const INIT_COMMAND = 'init';

export const ENV_VARIABLE_CONFIG_PREFIX = 'BIT_CONFIG_';
/**
* bit global config keys
*/
Expand Down
7 changes: 4 additions & 3 deletions components/legacy/global-config/global-config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import gitconfig from 'gitconfig';
import gitconfig from '@teambit/gitconfig';
import R from 'ramda';
import { BitError } from '@teambit/bit-error';
import { BASE_DOCS_DOMAIN, ENV_VARIABLE_CONFIG_PREFIX } from '@teambit/legacy.constants';
import Config from './config';

export const ENV_VARIABLE_CONFIG_PREFIX = 'BIT_CONFIG_';

export function set(key: string, val: string): Promise<Config> {
if (!key || !val) {
throw new BitError(`missing a configuration key and value. ${BASE_DOCS_DOMAIN}config/bit-config`);
throw new BitError(`missing a configuration key and value. https://bit.dev/config/bit-config`);
}
return Config.load().then((config) => {
config.set(key, val);
Expand Down
1 change: 1 addition & 0 deletions components/legacy/global-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export {
get,
list,
listSync,
ENV_VARIABLE_CONFIG_PREFIX,
} from './global-config';
2 changes: 1 addition & 1 deletion scopes/git/git/git.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs-extra';
import { BitError } from '@teambit/bit-error';
import { homedir } from 'os';
import { join } from 'path';
import gitconfig from 'gitconfig';
import gitconfig from '@teambit/gitconfig';
import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';
import { WorkspaceAspect, Workspace, BitmapMergeOptions } from '@teambit/workspace';
import { GitAspect } from './git.aspect';
Expand Down