Download and extract vscode-server in temp directory#196
Conversation
|
@MatthewCash It doesn't solve
Shouldn't a directory lock be used to fix that issue? |
Yeah probably, I don't use this anymore so if you have a better solution I would close this in favor of yours. |
|
Also see jeanp413/open-remote-wsl#12 and https://github.com/jeanp413/open-remote-wsl/issues/237 for the issue on the "sister extension". |
|
Shouldn't this be solved now by the updated setup script which deletes problematic/broken downloads/extracted paths? |
|
|
||
| # Check if server script is already installed | ||
| if [[ ! -f $SERVER_SCRIPT ]]; then | ||
| extract_dir="$(mktemp -d)" |
There was a problem hiding this comment.
I think this one should be followed by trap 'rm -rf "$extract_dir"; trap - EXIT; exit' EXIT INT HUP and then the final rm -rf below can be dropped (otherwise we'd need to add it to print_install_results_and_exit() as well.
In any case that should be moved after the pushd call below (and may even pushd to extract_dir as that would leave the other parts unchanged - we'd just cp -pr to SERVER_DIR at the end.
...and, as all other vars use upper-case - possibly use EXTRACT_DIR as well.
|
presumably made obsolete by #285 |
If either extraction is interrupted (with
$SERVER_SCRIPTat least partially-created) or multiple instances of the installation script run at the same time, the installation process becomes stuck and needs manual intervention.This fixes the issue by performing the time-consuming installation steps in a per-installation-instance temp directory and only copying the files over once extraction completes.