parent
d67dafaf1b
commit
8cc333d8d5
@ -2626,6 +2626,7 @@ upgradeGHCup :: ( MonadMask m
|
||||
upgradeGHCup mtarget force' = do
|
||||
Dirs {..} <- lift getDirs
|
||||
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
|
||||
PlatformRequest {..} <- lift getPlatformReq
|
||||
|
||||
lift $ logInfo "Upgrading GHCup..."
|
||||
let latestVer = fromJust $ fst <$> getLatest dls GHCup
|
||||
@ -2645,6 +2646,7 @@ upgradeGHCup mtarget force' = do
|
||||
copyFileE p
|
||||
destFile
|
||||
lift $ chmod_755 destFile
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinCodeSign _rPlatform destFile
|
||||
|
||||
liftIO (isInPath destFile) >>= \b -> unless b $
|
||||
lift $ logWarn $ T.pack (takeFileName destFile) <> " is not in PATH! You have to add it in order to use ghcup."
|
||||
|
@ -1028,6 +1028,17 @@ darwinNotarization Darwin path = exec
|
||||
Nothing
|
||||
darwinNotarization _ _ = pure $ Right ()
|
||||
|
||||
darwinCodeSign :: (MonadReader env m, HasDirs env, MonadIO m)
|
||||
=> Platform
|
||||
-> FilePath
|
||||
-> m (Either ProcessError ())
|
||||
darwinCodeSign Darwin path = exec
|
||||
"codesign"
|
||||
["-s", "-", path]
|
||||
Nothing
|
||||
Nothing
|
||||
darwinCodeSign _ _ = pure $ Right ()
|
||||
|
||||
|
||||
getChangeLog :: GHCupDownloads -> Tool -> Either Version Tag -> Maybe URI
|
||||
getChangeLog dls tool (Left v') =
|
||||
|
@ -296,6 +296,18 @@ download_ghcup() {
|
||||
esac
|
||||
EOF
|
||||
|
||||
case "${plat}" in
|
||||
"Darwin"|"darwin")
|
||||
case "${arch}" in
|
||||
aarch64|arm64|armv8l)
|
||||
codesign -s - "${GHCUP_BIN}"/ghcup
|
||||
;;
|
||||
*) : ;;
|
||||
esac
|
||||
;;
|
||||
*) : ;;
|
||||
esac
|
||||
|
||||
# shellcheck disable=SC1090
|
||||
edo . "${GHCUP_DIR}"/env
|
||||
eghcup upgrade
|
||||
|
Loading…
Reference in New Issue
Block a user