aws-amplify / aws-amplify/amplify-cli

In a post-add-function hook is there anyway to get what values the user selected for their function?

Open
#11,730 2 comments 0 reactions 0 assignees View on GitHub
feature-request p3 platform-hooks
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Amplify CLI Version

10.6.1

### Question

I want to set up a hook that will copy over some files when a new function is created and though the amplify hooks would be perfect for this but looking at the data that gets passed to the post-add-function hook I only have minimum data to work with:

```
{
amplify: {
environment: {
projectPath: 'C:\\work\\myApp',
envName: 'localdev',
defaultEditor: 'vscode'
},
command: 'add',
subCommand: 'function',
argv: [
'C:\\Users\\pete\\.amplify\\bin\\amplify.exe',
'C:\\snapshot\\repo\\build\\node_modules\\@aws-amplify\\cli-internal\\bin\\amplify',
'function',
'add'
],
version: '10.6.1'
}
}
```

I was hoping to have the function name, its folder path, function type etc. Basically everything selected in the wizard when you create a new function. Is this available or am I going to have to go sniffing?

Guessing I could just list the function folders out and order them by create date and pick the latest but just seems a bit messy so thought I'd ask.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.