I have a configuration file in JS that exports an array of of objects:
const configuration: ConfigData[] = [
{
pathToPage: 'some/path',
pathToComponent: 'components/some-component',
roles: [Roles.Admin],
},
{
pathToPage: 'some/path/2',
pathToComponent: iframeLoader,
roles: [Roles.User],
},
];
export default configuration;
I'd like to add a new object at the end of the array using a shell script, so that my file looks likes this:
const configuration: ConfigData[] = [
{
pathToPage: 'some/path',
pathToComponent: 'components/some-component',
roles: [Roles.Admin],
},
{
pathToPage: 'some/path/2',
pathToComponent: iframeLoader,
roles: [Roles.User],
},
{
pathToPage: 'some/path/3',
pathToComponent: iframeLoader,
roles: [Roles.User, Roles.Admin],
},
];
export default configuration;
Is that possible? If so, how do I do it?