MCPcopy Create free account
hub / github.com/deta/surf / createRustLicensePlugin

Function createRustLicensePlugin

app/plugins/rust-license.ts:141–157  ·  view source on GitHub ↗
(cargoTomlPath: string, outputName: string)

Source from the content-addressed store, hash-verified

139}
140
141export const createRustLicensePlugin = (cargoTomlPath: string, outputName: string) => {
142 const outputPath = join(process.cwd(), 'plugins', 'out', 'licenses', outputName)
143
144 return {
145 name: 'vite-plugin-rust-license',
146 generateBundle() {
147 try {
148 console.log(`Generating Rust license info for ${cargoTomlPath}...`)
149 this.info(`Generating Rust license info for ${cargoTomlPath}...`)
150 generateCargoLicenseFile(cargoTomlPath, outputPath)
151 } catch (error) {
152 this.warn(`Failed to generate Rust license info: ${error}`)
153 console.error(error)
154 }
155 }
156 } as Plugin
157}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected