Skip to content

Commit

Permalink
feat: hot update for resource
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Dec 8, 2023
1 parent caebb49 commit 52c67c5
Show file tree
Hide file tree
Showing 22 changed files with 887 additions and 341 deletions.
110 changes: 106 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions config_examples/asst.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ config = "CompatMac" # connect config name
# it's highly recommended to don't set this option, unless you know what you are doing
resource_base_dirs = ["/usr/local/share/maa"]
# the additional resources for non-cn clients
global_resources = ["global/YostarEN"]
global_resource = "YoStarEN"
# the additional resources for different platforms, only iOS is available now
# all base resource is for android, so only iOS need to be specified here
platform_resources = ["platform_diff/iOS"]
platform_diff_resource = "iOS"
# load resource from user config dir, load at last to override all other resources
user_resource = true

Expand Down
41 changes: 34 additions & 7 deletions config_examples/cli.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
# Configurations for MaaCore
[core]
channel = "Beta"
test_time = 0
channel = "Beta" # update channel of MaaCore, can be "Alpha", "Beta" or "Stable"
test_time = 0 # time to test the speed of mirrors, 0 to disable
# url of the MaaCore version api, used to get the latest version of MaaCore,
# leave it empty to use the default url
api_url = "https://github.com/MaaAssistantArknights/MaaRelease/raw/main/MaaAssistantArknights/api/version/"

# Configurations for whether to install given components of MaaCore
[core.components]
library = true
resource = true
library = true # whether to install libraries of MaaCore
resource = true # whether to install resources of MaaCore

# Configurations for maa-cli
[cli]
channel = "Alpha"
# the double v in @vversion is necessary instead of a typo
channel = "Alpha" # update channel of maa-cli, can be "Alpha", "Beta" or "Stable"
# url of the maa-cli version api, used to get the latest version of maa-cli,
# if you want to use jsdelivr, the double v in @vversion is necessary instead of a typo
api_url = "https://cdn.jsdelivr.net/gh/MaaAssistantArknights/maa-cli@vversion/"
# url to download latest version of maa-cli, leave it empty to use the default url
download_url = "https://github.com/MaaAssistantArknights/maa-cli/releases/download/"

# Configurations for whether to install given components of maa-cli
[cli.components]
binary = false
binary = false # whether to install binary of maa-cli

# Configurations for hot update of resource
# Note: this is different from `core.components.resource`, this is for hot update of resource
# while this is hot update resource of MaaCore
# You can not use this to hot update without any base resource
[resource]
auto_update = true # whether to auto update resource each time run maa task

# Configurations for remote git repository of resource
[resource.remote]
protocol = "https" # protocol of remote resource repository, can be "http" or "https"
host = "github.com" # host of remote resource repository
owner = "MaaAssistantArknights" # owner of remote resource repository
repo = "MaaResource" # repository name of remote resource repository
branch = "main" # branch of remote resource repository
# url of remote resource repository, leave it empty to contruct it from protocol, host, owner, repo
url = "[email protected]:MaaAssistantArknights/MaaResource.git"
1 change: 1 addition & 0 deletions maa-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ semver = { version = "1.0.19", features = ["serde"] }
# Dependencies used to extract files
flate2 = { version = "1", optional = true }
tar = { version = "0.4.40", optional = true }
git2 = "0.18.1"

[dependencies.chrono]
version = "0.4.31"
Expand Down
Loading

0 comments on commit 52c67c5

Please sign in to comment.