Skip to content

Is there a way to add a json item to an array without a key? #104

Answered by innocenzi
roni-estein asked this question in Help
Discussion options

You must be logged in to vote

Hello! The following should work:

await editFiles({
	files: 'composer.json',
	operations: [
		{ type: 'edit-json', merge: { scripts: { 'post-update-cmd': ['@php artisan filament:upgrade'] } } },
	],
	title: 'update package.json',
})

The difference with your snippet is that post-update-cmd is treated as an array.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@roni-estein
Comment options

Answer selected by innocenzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants