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

fix: .git can be a file or a directory #6319

Merged
merged 2 commits into from
Oct 6, 2024
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
4 changes: 3 additions & 1 deletion packages/cspell-gitignore/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export function factoryPathHelper(path: PathInterface): PathHelper {
}

async function findRepoRoot(directory: string): Promise<string | undefined> {
const found = await findUp('.git', { cwd: directory, type: 'directory' });
const foundDir = (await findUp('.git', { cwd: directory, type: 'directory' })) || '';
const foundFile = (await findUp('.git', { cwd: directory, type: 'file' })) || '';
const found = foundDir.length >= foundFile.length ? foundDir : foundFile;
if (!found) return undefined;
return path.dirname(found);
}
Expand Down
38 changes: 0 additions & 38 deletions packages/hunspell-reader/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,6 @@
"outFiles": [],
"sourceMaps": true,
"preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
"name": "hunspell: Run Mocha Current File",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": ["--timeout", "999999", "--colors", "--require", "ts-node/register", "${file}"],
"internalConsoleOptions": "openOnSessionStart",
"env": { "NODE_ENV": "test" }
},
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "hunspell: Run mocha",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
// Request type "launch" or "attach"
"request": "launch",
// Workspace relative or absolute path to the program.
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
// Automatically stop program after launch.
"stopOnEntry": false,
// Command line arguments passed to the program.
"args": [
"--timeout",
"999999",
"--colors",
"--compilers",
"ts:ts-node/register",
"--recursive",
"dist/**/*.test.js"
],
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
"cwd": "${workspaceRoot}",
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
"runtimeExecutable": null,
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
// Environment variables passed to the program.
"env": { "NODE_ENV": "test" }
}
]
}