diff --git a/app/Main.hs b/app/Main.hs index 74006af..be01aaa 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -171,7 +171,9 @@ installOrUpdate :: Text -> PackageName -> PackageInfo -> IO Turtle.FilePath installOrUpdate set pkgName PackageInfo{ repo, version } = do let pkgDir = ".psc-package" fromText set fromText (runPackageName pkgName) fromText version exists <- testdir pkgDir - unless exists . void $ cloneShallow repo version pkgDir + unless exists . void $ do + echoT ("Updating " <> runPackageName pkgName) + cloneShallow repo version pkgDir pure pkgDir getTransitiveDeps :: PackageSet -> [PackageName] -> IO [(PackageName, PackageInfo)] @@ -230,12 +232,6 @@ initialize = do packageNameFromPWD = either (const untitledPackageName) id . mkPackageName -update :: IO () -update = do - pkg <- readPackageFile - updateImpl pkg - echoT "Update complete" - install :: String -> IO () install pkgName' = do pkg <- readPackageFile @@ -313,11 +309,14 @@ listSourcePaths = do paths <- getPaths traverse_ (echoT . pathToTextUnsafe) paths --- | helper for calling through to @purs@ +-- | Helper for calling through to @purs@ -- --- extra args will be appended to the options +-- Extra args will be appended to the options exec :: [String] -> Bool -> [String] -> IO () exec execNames onlyDeps passthroughOptions = do + pkg <- readPackageFile + updateImpl pkg + paths <- getPaths let cmdParts = tail execNames srcParts = [ "src" "**" "*.purs" | not onlyDeps ] @@ -456,9 +455,6 @@ main = do [ Opts.command "init" (Opts.info (pure initialize) (Opts.progDesc "Initialize a new package")) - , Opts.command "update" - (Opts.info (pure update) - (Opts.progDesc "Update dependencies")) , Opts.command "uninstall" (Opts.info (uninstall <$> pkg Opts.<**> Opts.helper) (Opts.progDesc "Uninstall the named package"))