ollama/client/permissions-plugin.ts

25 lines
506 B
TypeScript
Raw Normal View History

2023-06-23 22:38:22 +00:00
import chmodr from 'chmodr'
import * as path from 'path'
interface PluginOptions {
resourcePath: string
}
class PermissionsPlugin {
options: PluginOptions
constructor(options: PluginOptions) {
this.options = options
}
apply(compiler: any) {
compiler.hooks.afterEmit.tap('PermissionsPlugin', () => {
chmodr(path.join(this.options.resourcePath), 0o755, err => {
// this fails on the first call to suppress the error
})
})
}
}
export default PermissionsPlugin