aws-amplify / aws-amplify/amplify-cli
add update functions hooks does not contain function name and other options
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
### How did you install the Amplify CLI?
npm install -g @aws-amplify/cli
### If applicable, what version of Node.js are you using?
v12.22.1
### Amplify CLI Version
6.3.1
### What operating system are you using?
Mac
### Amplify Categories
function
### Amplify Commands
add, update
### Describe the bug
created `post-update-function.js` and `post-add-function.js`
```
const fs = require('fs');
const parameters = JSON.parse(fs.readFileSync(0, { encoding: 'utf8' }));
// Get the running Amplify CLI major version number
const currentCLIMajorVersion = parameters.data.amplify.version.split('.')[0];
console.log(
'🚀 ~ file: post-add-function.js ~ line 7 ~ parameters.data',
parameters.data,
);
```
Then added function. also updated function. (function name is `aTest`)
Hooks called. but data does not contain what options I chose on questions. I can't know what is the function name
output:
```
----- 🪝 post-update-function execution start -----
🚀 ~ file: post-update-function.js ~ line 7 ~ parameters.data {
"data": {
"amplify": {
"environment": {
"projectPath": "/*****/",
"defaultEditor": "vscode",
"envName": "staging"
},
"command": "update",
"subCommand": "function",
"argv": [
"/Users/*****/.nvm/versions/node/v12.22.1/bin/node",
"/Users/*****/.nvm/versions/node/v12.22.1/bin/amplify",
"function",
"update"
],
"version": "6.3.1"
}
}
}
Amplify CLI major version: 6
Minimum required Amplify CLI major version: 5
Minimum CLI version requirement met.
----- 🪝 post-update-function execution end -----
```
### Expected behavior
options i selected or inputted on cli questions to be includedI
### Reproduction steps
created `post-update-function.js` and `post-add-function.js`
```
const fs = require('fs');
const parameters = JSON.parse(fs.readFileSync(0, { encoding: 'utf8' }));
// Get the running Amplify CLI major version number
const currentCLIMajorVersion = parameters.data.amplify.version.split('.')[0];
console.log(
'🚀 ~ file: post-add-function.js ~ line 7 ~ parameters.data',
parameters.data,
);
```
Then added function. also updated function. (function name is `aTest`)
Hooks called. but data does not contain what options I chose on questions. I can't know what is the function name
output:
```
----- 🪝 post-update-function execution start -----
🚀 ~ file: post-update-function.js ~ line 7 ~ parameters.data {
"data": {
"amplify": {
"environment": {
"projectPath": "/*****/",
"defaultEditor": "vscode",
"envName": "staging"
},
"command": "update",
"subCommand": "function",
"argv": [
"/Users/*****/.nvm/versions/node/v12.22.1/bin/node",
"/Users/*****/.nvm/versions/node/v12.22.1/bin/amplify",
"function",
"update"
],
"version": "6.3.1"
}
}
}
Amplify CLI major version: 6
Minimum required Amplify CLI major version: 5
Minimum CLI version requirement met.
----- 🪝 post-update-function execution end -----
```
### GraphQL schema(s)
_No response_
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.