Skip to content

Commit

Permalink
fix: apply override unformity to root-stack
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghosh committed Nov 5, 2021
1 parent 01b3ee1 commit 001f039
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { AmplifyRootStackTemplate } from '@aws-amplify/cli-overrides-helper';

export function overrideProps(props: AmplifyRootStackTemplate) {
return props;
}
export function override(resources: AmplifyRootStackTemplate) {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "overrides-for-root-stack",
"name": "overrides-dependencies",
"version": "1.0.0",
"description": "",
"scripts": {
Expand All @@ -8,8 +8,6 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@types/fs-extra": "^9.0.11",
"fs-extra": "^9.1.0",
"@aws-amplify/cli-overrides-helper": "1.1.0-ext11.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ export class AmplifyRootStackTransform {
amplifyPrinter.formatter.list(['No override File Found', `To override ${this._resourceName} run amplify override auth`]);
return '';
});
const rootStackTemplateObj = this._rootTemplateObj as AmplifyRootStackTemplate;
const sandboxNode = new vm.NodeVM({
console: 'inherit',
timeout: 5000,
sandbox: {},
});
try {
this._rootTemplateObj = sandboxNode.run(overrideCode).overrideProps(rootStackTemplateObj);
sandboxNode.run(overrideCode).overrideProps(this._rootTemplateObj);
} catch (err: $TSAny) {
const error = new Error(`Skipping override due to ${err}${os.EOL}`);
printer.error(`${error}`);
Expand Down

0 comments on commit 001f039

Please sign in to comment.