Skip to content

Commit

Permalink
Add type definition for ErrnoType in BetaPlugins.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
TfTHacker committed Dec 4, 2023
1 parent 217c6de commit c4c9fd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/features/BetaPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ export default class BetaPlugins {
}
}

type ErrnoType = {
errno: number;
};

const getRelease = async () => {
const rFiles = await this.getAllReleaseFiles(
repositoryPath,
Expand Down Expand Up @@ -295,7 +299,7 @@ export default class BetaPlugins {
pluginTargetFolderPath + 'manifest.json'
);
} catch (e) {
if (e.errno === -4058 || e.errno === -2) {
if ((e as ErrnoType).errno === -4058 || (e as ErrnoType).errno === -2) {
// file does not exist, try installing the plugin
await this.addPlugin(
repositoryPath,
Expand Down

0 comments on commit c4c9fd7

Please sign in to comment.