Last active
July 8, 2018 02:49
-
-
Save sillero/0293ac86e3f6224b7ff1c079b1fa2a67 to your computer and use it in GitHub Desktop.
Revisions
-
Gus Sillero renamed this gist
Jul 8, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Gus Sillero revised this gist
Jul 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,4 @@ TARGET=$(tr -d '\n' < $1) SOURCE=$(tr -d '\n' < $2) node -e "console.log(JSON.stringify({ ...$TARGET, ...$SOURCE }, false, 4))" -
Gus Sillero created this gist
Jul 8, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Requires nodejs Usage: ``` # extend-json <target-path> <source-path> extend-json a/package.json b/package.json > a/package.json ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ #!/bin/bash TARGET=$(tr -d '\n' < $1) SOURCE=$(tr -d '\n' < $2) node -e "console.log(JSON.stringify(Object.assign($TARGET, $SOURCE), false, 4))"