[web] refactoring: using the environment definition file URL from bauh-files

This commit is contained in:
Vinicius Moreira
2021-12-13 16:03:36 -03:00
parent 60217e9173
commit 6d7a2ff25f
2 changed files with 6 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ ELECTRON_DOWNLOAD_URL = 'https://github.com/electron/electron/releases/download/
ELECTRON_SHA256_URL = 'https://github.com/electron/electron/releases/download/v{version}/SHASUMS256.txt'
ELECTRON_WIDEVINE_URL = 'https://github.com/castlabs/electron-releases/releases/download/v{version}-wvvmp/electron-v{version}-wvvmp-linux-{arch}.zip'
ELECTRON_WIDEVINE_SHA256_URL = 'https://github.com/castlabs/electron-releases/releases/download/v{version}-wvvmp/SHASUMS256.txt'
URL_ENVIRONMENT_SETTINGS = f'https://raw.githubusercontent.com/vinifmor/{__app_name__}-files/master/web/env/v1/environment.yml'
URL_ENVIRONMENT_SETTINGS = f'https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/env/v2/environment.yml'
DESKTOP_ENTRY_PATH_PATTERN = f'{DESKTOP_ENTRIES_DIR}/{__app_name__}.web.' + '{name}.desktop'
URL_FIX_PATTERN = "https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/fix/{url}.js"
URL_SUGGESTIONS = "https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/env/v2/suggestions.yml"

View File

@@ -304,6 +304,11 @@ class EnvironmentUpdater:
try:
settings = yaml.safe_load(res.content)
nodejs_settings = settings.get('nodejs')
if nodejs_settings:
nodejs_settings['url'] = nodejs_settings['url'].format(version=nodejs_settings['version'])
except yaml.YAMLError:
self.logger.error(f'Could not parse environment settings: {res.text}')
self._finish_task_download_settings()