Skip to content

Commit

Permalink
Merge pull request #243 from softwaremill/post-generate-fix
Browse files Browse the repository at this point in the history
Change pwd for post generate hook to make it consistent with the rest of Fablo Config

Signed-off-by: Jakub Dzikowski <jakub.dzikowski@softwaremill.com>
  • Loading branch information
Jakub Dzikowski authored Nov 17, 2021
2 parents 31d49a1 + 75d1b45 commit ca652d4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ The following hook example will change `MaxMessageCount` to 1 in generated Hyper
```json
"hooks": {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \"./fabric-config/configtx.yaml\""
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \"./fablo-target/fabric-config/configtx.yaml\""
}
```
Expand Down
2 changes: 1 addition & 1 deletion e2e/__snapshots__/extendConfig.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7583,7 +7583,7 @@ Object {
},
],
"hooks": Object {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fabric-config/configtx.yaml\\"",
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fablo-target/fabric-config/configtx.yaml\\"",
},
"networkSettings": Object {
"capabilities": Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml should create pro
# The code from this file was called after Fablo generated Hyperledger Fabric configuration
echo \\"Executing post-generate hook\\"
perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fabric-config/configtx.yaml\\"
perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fablo-target/fabric-config/configtx.yaml\\"
"
`;
Expand Down
2 changes: 1 addition & 1 deletion e2e/__snapshots__/fabloCommands.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ Validation warnings count: 0
}
],
\\"hooks\\": {
\\"postGenerate\\": \\"perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\\\\\"./fabric-config/configtx.yaml\\\\\\"\\"
\\"postGenerate\\": \\"perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\\\\\"./fablo-target/fabric-config/configtx.yaml\\\\\\"\\"
}
}
"
Expand Down
2 changes: 1 addition & 1 deletion fablo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ generateNetworkConfig() {

mkdir -p "$fablo_target"
executeOnFabloDocker "fablo:setup-docker" "$fablo_target" "$fablo_config"
(cd "$fablo_target" && ./hooks/post-generate.sh)
("$fablo_target/hooks/post-generate.sh")
}

networkPrune() {
Expand Down
2 changes: 1 addition & 1 deletion samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ chaincodes:
directory: "./chaincodes/chaincode-java-simple"
hooks:
# changes MaxMessageCount to 1
postGenerate: "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \"./fabric-config/configtx.yaml\""
postGenerate: "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \"./fablo-target/fabric-config/configtx.yaml\""

0 comments on commit ca652d4

Please sign in to comment.