packageConfig'  :: IDEPackage -> (Bool -> IDEAction) -> IDEAction
packageConfig' package continuation = do
    prefs     <- readIDE prefs
    let dir = ipdPackageDir package
    useStack <- liftIO . doesFileExist $ dir </> "stack.yaml"
    if useStack
        then do
            ideMessage Normal (__ "Leksah is not running \"cabal configure\" because a stack.yaml file was found.")
            continuation True
        else do
            logLaunch <- getDefaultLogLaunch
            showDefaultLogLaunch'

            runExternalTool'        (__ "Configuring")
                                    (cabalCommand prefs)
                                    ("configure" : ipdConfigFlags package)
                                    dir $ do
                mbLastOutput <- C.getZipSink $ const <$> C.ZipSink sinkLast <*> C.ZipSink (logOutput logLaunch)
                lift $ do
                    mbPack <- idePackageFromPath (logOutput logLaunch) (ipdCabalFile package)
                    case mbPack of
                        Just pack -> do
                            changePackage pack
                            triggerEventIDE $ WorkspaceChanged False True
                            continuation (mbLastOutput == Just (ToolExit ExitSuccess))
                            return ()
                        Nothing -> do
                            postAsyncIDE $ ideMessage Normal (__ "Can't read package file")
                            continuation False
                            return()
packageConfig'  :: IDEPackage -> (Bool -> IDEAction) -> IDEAction
packageConfig' package continuation = do
    prefs     <- readIDE prefs
    let dir = ipdPackageDir package
    useStack <- liftIO . doesFileExist $ dir </> "stack.yaml"
    if useStack
        then do
            ideMessage Normal (__ "Leksah is not running \"cabal configure\" because a stack.yaml file was found.")
            continuation True
        else do
            logLaunch <- getDefaultLogLaunch
            showDefaultLogLaunch'

            runExternalTool'        (__ "Configuring")
                                    (cabalCommand prefs)
                                    ("configure" : ipdConfigFlags package)
                                    dir $ do
                mbLastOutput <- C.getZipSink $ const <$> C.ZipSink sinkLast <*> C.ZipSink (logOutput logLaunch)
                lift $ do
                    mbPack <- idePackageFromPath (logOutput logLaunch) (ipdCabalFile package)
                    case mbPack of
                        Just pack -> do
                            changePackage pack
                            triggerEventIDE $ WorkspaceChanged False True
                            continuation (mbLastOutput == Just (ToolExit ExitSuccess))
                            return ()
                        Nothing -> do
                            postAsyncIDE $ ideMessage Normal (__ "Can't read package file")
                            continuation False
                            return()
packageConfig' package continuation = do
    prefs     <- readIDE prefs
    let dir = ipdPackageDir package
    useStack <- liftIO . doesFileExist $ dir </> "stack.yaml"
    if useStack
        then do
            ideMessage Normal (__ "Leksah is not running \"cabal configure\" because a stack.yaml file was found.")
            continuation True
        else do
            logLaunch <- getDefaultLogLaunch
            showDefaultLogLaunch'

            runExternalTool'        (__ "Configuring")
                                    (cabalCommand prefs)
                                    ("configure" : ipdConfigFlags package)
                                    dir $ do
                mbLastOutput <- C.getZipSink $ const <$> C.ZipSink sinkLast <*> C.ZipSink (logOutput logLaunch)
                lift $ do
                    mbPack <- idePackageFromPath (logOutput logLaunch) (ipdCabalFile package)
                    case mbPack of
                        Just pack -> do
                            changePackage pack
                            triggerEventIDE $ WorkspaceChanged False True
                            continuation (mbLastOutput == Just (ToolExit ExitSuccess))
                            return ()
                        Nothing -> do
                            postAsyncIDE $ ideMessage Normal (__ "Can't read package file")
                            continuation False
                            return()