You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just trying to use Komondor from within a Beak script, since there you can also specify SwiftPM dependencies and run them separately from the Package.swift file. I'm already confused because of #18 and #19, but what I also don't understand is how the definition of a config parameter leads to Komondor to know what things to run? Does that mean that Komondor is parsing the Package.swift file and trying to find a PackageConfig object there, I'm really confused about how this works.
Here's what I'm trying at the moment using Beak:
#!/usr/bin/env beak run --path
// MARK: - Script Dependencies
// beak: shibapm/Komondor @ .upToNextMajor(from: "1.0.4")
import Foundation
import PackageConfig
// MARK: - Runnable Tasks
/// Registers git hooks for the project to ensure you get notified of potential issues e.g. before committing.
publicfunc register()throws{letconfig=PackageConfig(["komondor":["pre-commit":["bartycrouch lint --fail-on-warnings","swiftlint lint --strict --quiet"]]])
// TODO: make sure the `config` actually is being used by `kommondor install`, but how?
}
/// Unregisters any registered git hooks.
publicfunc unregister()throws{letconfig=PackageConfig(["komondor":[]])
// TODO: make sure the `config` actually is being applied by `kommondor install` and updates previous hooks, but how?
}
My goal is to have both a hooks register and a hooks unregister command setup which developers who checkout the project can run in order to – well, register or unregister all hooks I might define within that file. Also, how does Komondor behave when I change my hooks and re-run kommondor install, does it remove all removed hooks and also ensure no duplicates appear in the final configured hooks?
The text was updated successfully, but these errors were encountered:
Please note that I found a much easier way to configure git hooks in my project setup, so I won't need this feature, personally. Feel free to close it if you feel like you don't want it.
Sorry for reporting it first, then not actually needing it. 😅
If anyone is curious how I got it working using Beak, checkout our hooks.swift file.
I don't really know much about beak, the install script installs generic hooks which look in your config to decide if they should run or not. I think you miss the value of Komondor: it has a central & consistent way to do git hooks and is only responsible for running whatever is defined in your package.swift.
I'm not too suer what you're trying to do with the script in the OP, but I'm happy you found a way 👍
I'm just trying to use Komondor from within a Beak script, since there you can also specify SwiftPM dependencies and run them separately from the
Package.swift
file. I'm already confused because of #18 and #19, but what I also don't understand is how the definition of aconfig
parameter leads to Komondor to know what things to run? Does that mean that Komondor is parsing thePackage.swift
file and trying to find aPackageConfig
object there, I'm really confused about how this works.Here's what I'm trying at the moment using Beak:
My goal is to have both a
hooks register
and ahooks unregister
command setup which developers who checkout the project can run in order to – well, register or unregister all hooks I might define within that file. Also, how does Komondor behave when I change my hooks and re-runkommondor install
, does it remove all removed hooks and also ensure no duplicates appear in the final configured hooks?The text was updated successfully, but these errors were encountered: