Browse Source

fix: assets download folder

dev
Dnomd343 2 years ago
parent
commit
9bb53f7fa1
  1. 1
      src/loader/loader.c
  2. 6
      src/utils/assets.c

1
src/loader/loader.c

@ -127,7 +127,6 @@ crontab* load_crond(cleardns_config *config) {
assets* load_assets(cleardns_config *config) {
assets *resource = assets_init();
// TODO: use ASSETS_DIR
string_list_update(&resource->update_file, config->assets.update_file);
string_list_update(&resource->update_url, config->assets.update_url);
return resource;

6
src/utils/assets.c

@ -52,8 +52,10 @@ void assets_update() { // update all assets
log_info("Start assets update");
for (char **file = update.update_file; *file != NULL; ++file) {
char **url = file - update.update_file + update.update_url;
log_info("Update asset `%s` -> %s", *file, *url);
download_file(*file, *url); // download asset from url
char *asset_file = string_join(ASSETS_DIR, *file);
log_info("Update asset `%s` -> %s", asset_file, *url);
download_file(asset_file, *url); // download asset from url
free(asset_file);
}
log_info("Restart overture");
run_command("pgrep overture | xargs kill"); // restart overture

Loading…
Cancel
Save