Skip to content

Commit

Permalink
Merge pull request #221 from CodinGame/fix-vsix-plugin
Browse files Browse the repository at this point in the history
Fix vsix plugin
  • Loading branch information
CGNonofr authored Oct 26, 2023
2 parents dc27a6a + 7c78c9f commit 29f389a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rollup-vsix-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Options {
exclude?: FilterPattern
rollupPlugins?: InputPluginOption[]
transformManifest?: (manifest: IExtensionManifest) => IExtensionManifest
getAdditionalResources?: (manifest: IExtensionManifest) => Promise<ExtensionResource[]>
getAdditionalResources?: (manifest: IExtensionManifest, getFileContent: (path: string) => Promise<Buffer>, listFiles: (path: string) => Promise<string[]>) => Promise<ExtensionResource[]>
}

function read (stream: Readable): Promise<Buffer> {
Expand Down Expand Up @@ -86,15 +86,15 @@ export default function plugin ({
const getFileContent = async (filePath: string): Promise<Buffer> => {
return readFileSync(filePath)
}
const listFiles = async (path: string) => {
return (vsixFS.readdirSync(path) as string[])
const listFiles = async (filePath: string) => {
return (vsixFS.readdirSync(path.join('/', filePath)) as string[])
}
const extensionResources = (await extractResourcesFromExtensionManifest(manifest, getFileContent, listFiles))
.filter(resource => vsixFS.existsSync(path.join('/', resource.realPath ?? resource.path)))

const resources = [
...extensionResources,
...await getAdditionalResources(manifest)
...await getAdditionalResources(manifest, getFileContent, listFiles)
]

const pathMapping = (await Promise.all(resources.map(async resource => {
Expand Down

0 comments on commit 29f389a

Please sign in to comment.