Skip to content

Commit

Permalink
Merge pull request #23 from prasadp-qp/bugfix/Issue#21
Browse files Browse the repository at this point in the history
Issue#21: Expose git hook input params as shell env vars
  • Loading branch information
orta authored Aug 17, 2019
2 parents ee14760 + d7ec9ae commit 6152f88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
9 changes: 0 additions & 9 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@
"revision": "f43166a8e18fdd0857f29e303b1bb79a5428bca0",
"version": "4.9.0"
}
},
{
"package": "Yams",
"repositoryURL": "https://github.com/jpsim/Yams.git",
"state": {
"branch": null,
"revision": "b08dba4bcea978bf1ad37703a384097d3efce5af",
"version": "1.0.2"
}
}
]
},
Expand Down
5 changes: 4 additions & 1 deletion Sources/Komondor/Commands/runner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ public func runner(logger _: Logger, args: [String]) throws {
do {
try commands.forEach { command in
print("> \(command)")
let gitParams = Array(args.dropFirst())
// Exporting git hook input params as shell env var GIT_PARAMS
let cmd = "export GIT_PARAMS=\(gitParams.joined(separator: " ")) ; \(command)"
// Simple is fine for now
print(try shellOut(to: command))
print(try shellOut(to: cmd))
// Ideal:
// Store STDOUT and STDERR, and only show it if it fails
// Show a stepper like system of all commands
Expand Down
2 changes: 1 addition & 1 deletion Sources/Komondor/Installation/renderScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public func renderScript(_ hookName: String, _ swiftPackagePath: String) -> Stri
komondor=${komondor:-'swift run komondor'}
# run hook
$komondor run \(hookName)
$komondor run \(hookName) $gitParams
fi
"""
}

0 comments on commit 6152f88

Please sign in to comment.