Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,14 @@ If you decide so, you can read up on how to do it [here][package-sets-contributi
The version of the package-set you depend on is fixed in the `packages.dhall` file
(look for the `upstream` var).

You can upgrade to the latest version of the package-set with the `package-set-upgrade`
You can upgrade to the latest version of the package-set with the `upgrade-set`
command, that will automatically find out the latest version, download it, and write
the new url and hashes in the `packages.dhall` file for you.

Running it would look something like this:

```bash
$ spago package-set-upgrade
$ spago upgrade-set
Found the most recent tag for "purescript/package-sets": "psc-0.12.3-20190227"
Package-set upgraded to latest tag "psc-0.12.3-20190227"
Fetching the new one and generating hashes.. (this might take some time)
Expand Down
2 changes: 1 addition & 1 deletion app/Curator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ spagoUpdater token controlChan fetcherChan = go Nothing
, "git pull --rebase"
, "git checkout -B master origin/master"
, "cd templates"
, "spago package-set-upgrade"
, "spago upgrade-set"
, "cd .."
, "git checkout -B " <> Text.unpack branchName
, "git add templates/packages.dhall"
Expand Down
6 changes: 3 additions & 3 deletions app/Spago.hs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ parser = do
, listPackages
, verify
, verifySet
, packageSetUpgrade
, upgradeSet
, freeze
]

Expand Down Expand Up @@ -270,8 +270,8 @@ parser = do
, VerifySet <$> limitJobs <*> cacheFlag
)

packageSetUpgrade =
( "package-set-upgrade"
upgradeSet =
( "upgrade-set"
, "Upgrade the upstream in packages.dhall to the latest package-sets release"
, pure PackageSetUpgrade
)
Expand Down
4 changes: 2 additions & 2 deletions src/Spago/Messages.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ packageSetVersionWarning = makeMessage
[ "WARNING: the package-set version you're on doesn't check if the version of the"
, "PureScript compiler installed on your system is compatible."
, "If your build fails you might want to upgrade your set by running this command:"
, "`spago package-set-upgrade`"
, "`spago upgrade-set`"
, ""
]

Expand All @@ -146,7 +146,7 @@ pursVersionMismatch currentVersion minVersion = makeMessage
, ""
, "There are a few ways to solve this:"
, "- install a compatible `purs` version (i.e. in the same 'semver range' as the one in the package set)"
, "- if the `purs` version is 'too new', you can try using `spago package-set-upgrade` to upgrade to the latest package set"
, "- if the `purs` version is 'too new', you can try using `spago upgrade-set` to upgrade to the latest package set"
, "- if you know what you're doing and you want to void this check, you can override the `version` of the `metadata` package in the packages.dhall"
, ""
]
Expand Down
2 changes: 1 addition & 1 deletion src/Spago/PackageSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ makePackageSetFile force = do
-- - if all of this succeeds, it will regenerate the hashes and write to file
upgradePackageSet :: Spago m => m ()
upgradePackageSet = do
echoDebug "Running `spago package-set-upgrade`"
echoDebug "Running `spago upgrade-set`"
try getLatestRelease >>= \case
Left (err :: SomeException) -> echoDebug $ Messages.failedToReachGitHub err
Right releaseTagName -> do
Expand Down
4 changes: 2 additions & 2 deletions test/SpagoSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ spec = around_ setup $ do
spago ["test"] >>= shouldBeSuccessOutput "test-output.txt"


describe "spago package-set-upgrade" $ do
describe "spago upgrade-set" $ do

it "Spago should migrate package-sets from src/packages.dhall to the released one" $ do

Expand All @@ -213,7 +213,7 @@ spec = around_ setup $ do
$ filter (not . null . Text.breakOnAll "https://github.com/purescript/package-sets")
$ Text.lines packages
writeTextFile "packages.dhall" "https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.0-20190713/src/packages.dhall sha256:906af79ba3aec7f429b107fd8d12e8a29426db8229d228c6f992b58151e2308e"
spago ["package-set-upgrade"] >>= shouldBeSuccess
spago ["upgrade-set"] >>= shouldBeSuccess
newPackages <- fmap Text.strip $ readTextFile "packages.dhall"
newPackages `shouldBe` packageSetUrl

Expand Down