Skip to content

Commit

Permalink
Interpret register script file name relative to working-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mpickering committed Aug 29, 2024
1 parent 027bddf commit a41f5f2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Cabal/src/Distribution/Simple/Register.hs
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,15 @@ writeHcPkgRegisterScript verbosity mbWorkDir ipis packageDbs hpi = do
-- TODO: Do something more robust here
regScript = unlines scripts

info verbosity ("Creating package registration script: " ++ regScriptFileName)
writeUTF8File regScriptFileName regScript
setFileExecutable regScriptFileName
let out_file = interpretSymbolicPath mbWorkDir regScriptFileName
info verbosity ("Creating package registration script: " ++ out_file)
writeUTF8File out_file regScript
setFileExecutable out_file

regScriptFileName :: FilePath
regScriptFileName :: SymbolicPath Pkg File
regScriptFileName = case buildOS of
Windows -> "register.bat"
_ -> "register.sh"
Windows -> makeSymbolicPath "register.bat"
_ -> makeSymbolicPath "register.sh"

-- -----------------------------------------------------------------------------
-- Making the InstalledPackageInfo
Expand Down

0 comments on commit a41f5f2

Please sign in to comment.