Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchen committed Jan 20, 2025
1 parent c0e7fdd commit b011225
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ string.Format("{0,-20}", 123);


## `ToString` & `IFormattable`


## Formatting Strategy
22 changes: 14 additions & 8 deletions docs/services/GithubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,21 @@ class GithubRepositoryEndPointMethods {
const split = repo.split('/');
const owner = split[0];
const _repo = split[1];
return (
await octokit.rest.repos.getContent({
owner: owner,
repo: _repo,
path: path,
})
).data as RepoFileSystemInfo;
try {
return (
await octokit.rest.repos.getContent({
owner: owner,
repo: _repo,
path: path,
})
).data as RepoFileSystemInfo;
} catch (error) {
console.error(`failed to fetch remote file from github repo: ${repo}/${path}`);
console.log(
`The path might have been changed, check out: "https://github.com/${repo}/${path}"`,
);
}
}
throw new Error();
}
}
export class GithubService {
Expand Down
12 changes: 10 additions & 2 deletions docs/services/ThemeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ export type RemoteThemeInfo = {
};

const themeInfos = {
'Eva Light': { repo: 'fisheva/Eva-Theme', path: 'themes/Eva-Light.json', branch: 'master' },
'Eva Dark': { repo: 'fisheva/Eva-Theme', path: 'themes/Eva-Dark.json', branch: 'master' },
'Eva Light': {
repo: 'fisheva/Eva-Theme',
path: 'VSCode/themes/Eva-Light.json',
branch: 'master',
},
'Eva Dark': {
repo: 'fisheva/Eva-Theme',
path: 'VSCode/themes/Eva-Dark.json',
branch: 'master',
},
} satisfies Record<string, RemoteThemeInfo>;

export type ThemeName = keyof typeof themeInfos;
Expand Down

0 comments on commit b011225

Please sign in to comment.