@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
32 lines (27 loc) • 773 B
text/typescript
import SyncAction from '../../features/view/actions/SyncAction'
import ViewWriter from '../../features/view/writers/ViewWriter'
export default class ViewFixture {
private writer: ViewWriter
private cwd: string
private syncAction: SyncAction
public constructor(
cwd: string,
viewWriter: ViewWriter,
syncAction: SyncAction
) {
this.cwd = cwd
this.writer = viewWriter
this.syncAction = syncAction
}
public async createViewController(options: {
namePascal: string
nameKebab: string
}) {
const files = await this.writer.writeSkillViewController(
this.cwd,
options
)
await this.syncAction.execute()
return files[0]
}
}