Skip to content

Commit cbedf45

Browse files
committed
refactor: show cwd in meta
1 parent 17d60ba commit cbedf45

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

packages/cli-utils/src/definitions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ export interface IonicEnvironment {
514514
readonly log: ILogger;
515515
readonly prompt: PromptModule;
516516
meta: {
517+
cwd: string;
517518
local: boolean; // CLI running in local mode?
518519
binPath: string;
519520
libPath: string;

packages/cli-utils/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ async function getSession(config: IConfig<ConfigFile>, project: IProject, client
124124
}
125125

126126
export async function generateIonicEnvironment(plugin: RootPlugin, pargv: string[], env: { [key: string]: string }): Promise<IonicEnvironment> {
127+
const cwd = process.cwd();
127128
const argv = minimist(pargv, { boolean: true, string: '_' });
128129
const config = new Config(env['IONIC_CONFIG_DIRECTORY'] || CONFIG_DIRECTORY, CONFIG_FILE);
129130
const configData = await config.load();
@@ -181,10 +182,10 @@ export async function generateIonicEnvironment(plugin: RootPlugin, pargv: string
181182
configData.yarn = argv['yarn'];
182183
}
183184

184-
const projectDir = await findBaseDirectory(process.cwd(), PROJECT_FILE);
185+
const projectDir = await findBaseDirectory(cwd, PROJECT_FILE);
185186

186187
if (!projectDir) {
187-
const foundDir = await findBaseDirectory(process.cwd(), PROJECT_FILE_LEGACY);
188+
const foundDir = await findBaseDirectory(cwd, PROJECT_FILE_LEGACY);
188189

189190
if (foundDir) {
190191
log.warn(`${chalk.bold(PROJECT_FILE_LEGACY)} file found in ${chalk.bold(foundDir)}--please rename it to ${chalk.bold(PROJECT_FILE)}, or your project directory will not be detected!`);
@@ -244,6 +245,7 @@ export async function generateIonicEnvironment(plugin: RootPlugin, pargv: string
244245
load,
245246
log,
246247
meta: {
248+
cwd,
247249
local: env['IONIC_CLI_LOCAL'] ? true : false,
248250
binPath: env['IONIC_CLI_BIN'],
249251
libPath: env['IONIC_CLI_LIB'],

0 commit comments

Comments
 (0)