Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Auto Setup of Cate WebAPI

Norman Fomferra edited this page May 9, 2018 · 2 revisions

Described here is how Cate Desktop performs the auto setup.

Here, $NEW_VERSION is the expected Cate WebAPI version, $OLD_VERSION is the version used found, if any.

  • get set-up action info (code in src/main/appenv.ts/getCateCliSetupInfo())
    • if exists ~/.cate
      • for each existing ~/.cate/$VERSION/cate.location:
        • Read Cate dir from ~/.cate/$VERSION/cate.location
        • if $VERSION is $NEW_VERSION
          • set-up action: none, reuse Cate in Cate dir, old version and new version are $NEW_VERSION
        • if $VERSION is $NEW_VERSION
          • Collect it Cate dir in list
      • Sort collected Cate dir list by $VERSION in descending order
      • For each Cate dir in sorted Cate dirs list:
        • If $VERSION is compatible with $NEW_VERSION:
          • If $VERSION is less than $NEW_VERSION:
            • set-up action: update Cate in Cate dir, old version is $VERSION, new version is $NEW_VERSION
          • Else
            • set-up action: none, reuse Cate in Cate dir, old version and new version are $NEW_VERSION
      • For each Cate dir in sorted Cate dirs list:
        • If $VERSION is less than $NEW_VERSION:
          • set-up action: update Cate in Cate dir, old version is $VERSION, new version is $NEW_VERSION Cate dir is ~/cate-$NEW_VERSION/
    • set-up action: install Cate in Cate dir, old version is none, new version is $NEW_VERSION
  • if set-up action is none:
    • done - do nothing
  • if setup-action is update Cate:
    • install cate-$NEW_VERSION package into Cate env given by Cate dir
  • if setup-action is install Cate:
    1. download miniconda
    2. install miniconda into Cate dir
    3. install cate-$NEW_VERSION package into Cate env given by Cate dir
  • Write Cate dir to ~/.cate/$NEW_VERSION/cate.location
  • done

Clone this wiki locally