Skip to content

Commit

Permalink
fix: fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 authored Jan 25, 2024
1 parent 8fe83f3 commit aa67f3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ const run = async () => {
apiJson = load(apiYaml);
}

if (!apiJson?.servers || apiJson?.servers?.length === 0) {
apiJson.servers = [
{
url: 'https://' + manifestJson.api.url.split('/')[2],
},
];
}

if (overrides?.openapi) {
apiJson = merge(apiJson, overrides.openapi);
}
Expand Down
9 changes: 0 additions & 9 deletions src/syncList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ const PluginList: PluginItem[] = [
},
{
manifest: 'https://plugin.askyourpdf.com/.well-known/ai-plugin.json',
overrides: {
openapi: {
servers: [
{
url: 'https://plugin.askyourpdf.com',
},
],
},
},
path: 'ask-your-pdf',
tags: ['pdf', 'document', 'web'],
},
Expand Down
5 changes: 1 addition & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export const writeJSON = (filePath, data) => {
writeFileSync(filePath, jsonStr, 'utf8');
};

export const writeYAML = (filePath, data) => {
writeFileSync(filePath, data, 'utf8');
};

export const getDomainFromUrl = (url) => {
const withoutProtocol = url.replace(/^https?:\/\//, '');
const domain = withoutProtocol.split('/')[0];
Expand All @@ -24,5 +20,6 @@ export const getAuthor = (url) => {
const withoutProtocol = url.replace(/^https?:\/\//, '');
const domain = withoutProtocol.split('/')[0];
const domains = domain.split(':')[0].split('.');
if (domains[1] === 'vercel') return domains[0];
return domains.length > 2 ? domains[1] : domains[0];
};

0 comments on commit aa67f3b

Please sign in to comment.