-
-
Notifications
You must be signed in to change notification settings - Fork 86
chore: replace find-up -> empathic #205
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,13 @@ | ||
| import path from 'path' | ||
|
|
||
| import findUp from 'find-up' | ||
| import { Output, exec } from 'tinyexec' | ||
| import * as find from 'empathic/find' | ||
| import { exec, Output } from 'tinyexec' | ||
|
|
||
| export const name = 'hg' | ||
|
|
||
| export const detect = (directory: string) => { | ||
| const hgDirectory = findUp.sync('.hg', { | ||
| cwd: directory, | ||
| type: 'directory', | ||
| }) | ||
| if (hgDirectory) { | ||
| return path.dirname(hgDirectory) | ||
| } | ||
| const found = find.up('.hg', { cwd: directory }) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if there is a
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's always a directory. If you have a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, that just means there is a
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can stat the result to check if it's a directory, tho the odds of this happening is very low.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's how previous codes work. Dependency migration should not change any current behavior. |
||
| if (found) return path.dirname(found) | ||
| } | ||
|
|
||
| const runHg = (directory: string, args: string[]) => | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.