Skip to content

Commit

Permalink
Multi-architecture support (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Diegorro98 authored Oct 17, 2023
1 parent c1d9369 commit ec3caa6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions custom_components/ha_vscode/vscode_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

LOGGER: logging.Logger = logging.getLogger(PACKAGE_NAME)

architecture_map = {
"x86_64": "x64",
"armv7l": "armhf",
"aarch64": "arm64",
}

class VSCodeDeviceAPI:
"""Command line VSCode Tunnel OAuth device flow"""
Expand Down Expand Up @@ -51,10 +56,11 @@ def __init__(self, storage_dir):
def downloadViaCurl(self, outdir):
# curl -Lk https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64 --output /workspaces/ha_core/config/custom_components/ha_vscode/bin/vscode_cli.tar.gz
result = None
architecture = os.uname().machine
getVSCodeCLIcurl = [
"curl",
"-Lk",
"https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64",
f"https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-{architecture_map[architecture]}",
"--output",
outdir,
]
Expand Down Expand Up @@ -83,9 +89,10 @@ def downloadViaWGet(self, outdir):
# wget https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64 -O /workspaces/ha_core/config/custom_components/ha_vscode/bin/vscode_cli.tar.gz

result = None
architecture = os.uname().machine
getVSCodeCLIwget = [
"wget",
"https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64",
f"https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-{architecture_map[architecture]}",
"-O",
outdir,
]
Expand Down

0 comments on commit ec3caa6

Please sign in to comment.