on master help sign in
command: Get free port immediately before starting server
commit513528715d2b0c08a7f0e2742f31dfbfd3f90117 authorElliot Cameron <eacameron@gmail.com> dateMon 10 Feb 2020, 16:43 (7 years ago) parent186633c
1 file changed+1−1
lib/command/src/Obelisk/Command/Run.hs+1−1
lib/command/src/Obelisk/Command/Run.hs+1−1
@@ -74,7 +74,6 @@ run :: MonadObelisk m => m ()
7474run = withProjectRoot "." $ \root -> do
7575 pkgs <- fmap toList . parsePackagesOrFail =<< getLocalPkgs root
7676 withGhciScript pkgs root $ \dotGhciPath -> do
77− freePort <- getFreePort
7877 assets <- do
7978 isDerivation <- readProcessAndLogStderr Debug $ setCwd (Just root) $
8079 proc nixExePath
@@ -94,6 +93,7 @@ run = withProjectRoot "." $ \root -> do
9493 else readProcessAndLogStderr Debug $ setCwd (Just root) $
9594 proc nixExePath ["eval", "-f", ".", "passthru.staticFilesImpure", "--raw"]
9695 putLog Debug $ "Assets impurely loaded from: " <> assets
96+ freePort <- getFreePort
9797 runGhcid root True dotGhciPath pkgs $ Just $ unwords
9898 [ "Obelisk.Run.run"
9999 , show freePort