docs: updating the example action to be valid typescript :)

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-03-07 17:56:07 +01:00
parent 24d159b0a7
commit 6aa109828d
@@ -19,7 +19,7 @@ passed as `input` to the function.
In `packages/backend/src/actions/custom.ts` we can create a new action.
```ts
import { createTemplateAction } from '../../createTemplateAction';
import { createTemplateAction } from '@backstage/plugin-scaffolder-backend';
import fs from 'fs-extra';
export const createNewFileAction = () => {
@@ -35,7 +35,7 @@ export const createNewFileAction = () => {
title: 'Contents',
description: 'The contents of the file',
},
contents: {
filename: {
type: 'string',
title: 'Filename',
description: 'The filename of the file that will be created',
@@ -46,7 +46,7 @@ export const createNewFileAction = () => {
async handler(ctx) {
await fs.outputFile(
`${ctx.workspacePath}/${ctx.input.filename}`,
ctx.input.content,
ctx.input.contents,
);
},
});