gh 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+20/−12 lines, 3 files
Files
- CHANGELOG.md +5/−0
- gh.cabal +3/−1
- src/GH/Signoff.hs +12/−11
+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# Changelog for `gh`++## 0.1.0.1++- Initial release
gh.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: gh-version: 0.1.0.0+version: 0.1.0.1 synopsis: Haskell bindings for gh CLI description: A standalone library for gh CLI operations category: System@@ -15,6 +15,8 @@ copyright: 2025 Juspay license: MIT build-type: Simple+extra-source-files:+ CHANGELOG.md library exposed-modules:
src/GH/Signoff.hs view
@@ -4,11 +4,11 @@ A standalone library for gh-signoff operations. -}-module GH.Signoff (ghSignoffProcess) where+module GH.Signoff (create, Force (..)) where -import System.Info qualified as SysInfo import System.Process (CreateProcess, proc) import System.Which (staticWhich)+import Prelude hiding (force) {- | Path to the `gh-signoff` executable @@ -17,14 +17,15 @@ ghSignoffBin :: FilePath ghSignoffBin = $(staticWhich "gh-signoff") -{- | System platform string+-- | Force flag for signoff operations+data Force = Force | NoForce deriving stock (Show, Eq) -Computed from System.Info at runtime in Nix format (arch-os).--}-nixSystem :: String-nixSystem = SysInfo.arch <> "-" <> SysInfo.os+{- | Create a 'CreateProcess' to run @gh-signoff create@ --- | Create a process to run gh-signoff create with force flag and platform context-ghSignoffProcess :: String -> String -> CreateProcess-ghSignoffProcess name k =- proc ghSignoffBin ["create", "-f", name <> "/" <> nixSystem <> "/" <> k]+Parameters:+ * force: Whether to use the --force flag+ * name: The signoff name argument+-}+create :: Force -> String -> CreateProcess+create force name =+ proc ghSignoffBin $ "create" : (["--force" | force == Force] <> [name])