Code Monkey home page Code Monkey logo

vscode-dl's Introduction

VSCode Downloader

Build Status pyi pyi Code style: black

Description

vscode-dl is a Python3 script that downloads the latest Linux version of Visual Studio Code and a curated list of extensions for installation on computers without Internet connection or proxy restrictions.

The program also creates a catalog in JSON and Markdown that can be incorporated into a web page, like this example.

When run again, it tries to update extensions and VSCode to their latest version.

Installation

Requirements

  • Python3 : version >= 3.6 (older ones won't work because of f-strings). The companion tool (see below) requires Python >= 3.5.

pip

This installs the latest stable, released version.

pip3 install -U vscode-dl

virtualenv

python3 -m venv vscode-dl
vscode-dl/bin/pip install vscode-dl
vscode-dl/bin/vscode-dl --help

from GitHub repository

pip3 install -r requirements.txt

# install the package
python3 setup.py install

# run directly from source
cd src/vscode_dl
./vscode_dl.py --help

Basic usage

Download Visual Studio Code and extensions listed in extensions.yaml (if found, otherwise the default list) into the web/ subdirectory (screenshot) :

vscode-dl

Scan installed extensions and add them to the download list :

vscode-dl -i

More options are available. Use vscode-dl --help to show them.

Run with Docker

A Dockerfile is provided to run the app into a container, with interpreter and requirements ready-to-use.

# build the image
docker build -t vscode-dl .

# run the downloader
docker run -ti --rm -v /path/to/mirror:/app/web vscode-dl

# run the downloader with an alternate extension list
docker run -ti --rm -v /path/to/mirror:/app/web -v /path/to/extensions.yaml:/app/extensions.yaml vscode-dl

Installation and update tool

First use

On a offline installation, get.py install or updates Code, downloads and updates the installed extensions from the mirror.

It requires Python 3.5+ and requests that should be installed on all modern Debian/Ubuntu.

curl -skL http://mirror.url:port/get.py | python3 - http://mirror.url:port/

The flag -t permits to provide a minimal set of extensions to be installed. They should be listed in a JSON array.

Example of a file myteam.json (to be copied in the mirror directory):

["ms-python.python", "formulahendry.code-runner"]

The following command wil install or update Code and the extensions listed above.

python3 <(curl -sL http://mirror.url:port/get.py) -t myteam http://mirror.url:port/

The companion tool : code-tool

The tool installs itself into ~/.local/bin/code-tool. This tool can be used to maintenance tasks and install new extensions. You may have to add this directory to your PATH.

# update Code and extensions
code-tool -u

# display version and mirror url
code-tool -V

# list available extensions
code-tool -l

# install an extension
code-tool -i <extension.key>

More options are available. Use code-tool --help to show them.

The development container

Code allows you to develop inside a container. Unluckily, this feature requires Internet connection since the remote server is downloaded when attaching to the container, unless this server is already installed. This is the aim of scripts into container/ subdirectory.

It can be easily adapted to an existing build environment, even for SSH remote development.

As the time of writing (December 2019), only x64, armhf, arm64 and Alpine/amd64 platforms are available.

The Go extension case

The Go extension requires some Go packages to be functional (linter, formatter, code analyzer, etc.). These dependencies are listed into the extension, that tries to install them from Internet. To bypass this step, the sync program (vscode-dl uses go get -d command to download the required packages, and the update tool (get.py aka. code-tool) installs them in ~/go (default GOPATH). Thus, the GOPATH environment variable should include at least this directory.

Links

License

Unlicense aka. Public Domain ๐Ÿ˜€

vscode-dl's People

Contributors

rene-d avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.