Skip to content

Commit

Permalink
improve cli tracing (#8053)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav authored Oct 10, 2024
1 parent fc82eec commit 14bf2eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/insomnia-inso/src/db/adapters/git-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ const gitAdapter: DbAdapter = async (dir, filterTypes) => {
if (!dir) {
return null;
}
const workspaceFolder = path.join(dir, '.insomnia', 'Workspace');
const insomniaFolder = path.join(dir, '.insomnia');
let files = null;
try {
await fs.promises.readdir(workspaceFolder);
files = await fs.promises.readdir(insomniaFolder);
} catch (error) {
// console.error(`Failed to read "${workspaceFolder}"`, error);
if (files?.length === 0) {
console.error(`.insomnia folder found at "${insomniaFolder}"
but no files found inside. Ensure your workingDir is correct.`);
}
return null;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/insomnia-inso/src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export const loadDb = async ({

logger.warn(
`No git, app data store or Insomnia V4 export file found at path "${pathToSearch}",
re-run --verbose to see tracing information`,
--workingDir/-w should point to a git repository root, an Insomnia export file or a directory containing Insomnia data.
re-run with --verbose to see tracing information`,
);

return emptyDb();
Expand Down

0 comments on commit 14bf2eb

Please sign in to comment.