-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨feat: add webtools checkDefaultBrowser and rm v8-cache
- Loading branch information
1 parent
d6e7d56
commit 197bb61
Showing
6 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/usr/bin/env node | ||
|
||
require("v8-compile-cache"); | ||
require("../dist/cli/cli") | ||
.run() | ||
.catch((e) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { DoctorLevel } from "@doctors/core"; | ||
import { IApi } from "../type"; | ||
import { chalkByDoctorLevel } from "@doctors/utils"; | ||
|
||
export default (api: IApi) => { | ||
api.addDoctorWebToolsCheck(async () => { | ||
const defaultBrowser = await import("default-browser"); | ||
const defaultBrowserName = (await defaultBrowser.default()).name; | ||
const description = `Set the Chrome as default browser is best ${chalkByDoctorLevel( | ||
DoctorLevel.SUCCESS, | ||
`Now: ${defaultBrowserName}` | ||
)}`; | ||
if (defaultBrowserName === "Chrome") { | ||
return { | ||
label: "Default Browser", | ||
description, | ||
doctorLevel: DoctorLevel.SUCCESS, | ||
}; | ||
} else { | ||
return { | ||
label: "Default Browser", | ||
description, | ||
doctorLevel: DoctorLevel.WARN, | ||
}; | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export default [ | ||
require.resolve("./checkNode"), | ||
require.resolve("./checkChrome"), | ||
require.resolve("./checkDefaultBrowser"), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters