diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-02 14:09:50 -0400 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-02 14:09:50 -0400 |
commit | 3157898f13a6990aff909e8e4af7f58515a28e8c (patch) | |
tree | 773ec943df45a679fa4a0f221b871b7248be50d7 /extension/scripts | |
parent | 6b909caa8dcbd4bf3d1078ded1c12146944ab349 (diff) | |
parent | aea318b48dd7e15df16eca12ba59c677671869aa (diff) | |
download | sncontinue-3157898f13a6990aff909e8e4af7f58515a28e8c.tar.gz sncontinue-3157898f13a6990aff909e8e4af7f58515a28e8c.tar.bz2 sncontinue-3157898f13a6990aff909e8e4af7f58515a28e8c.zip |
Merge branch 'main' into docs
Diffstat (limited to 'extension/scripts')
-rw-r--r-- | extension/scripts/continuedev-0.1.0-py3-none-any.whl | bin | 61142 -> 55662 bytes | |||
-rw-r--r-- | extension/scripts/install_from_source.py | 63 |
2 files changed, 63 insertions, 0 deletions
diff --git a/extension/scripts/continuedev-0.1.0-py3-none-any.whl b/extension/scripts/continuedev-0.1.0-py3-none-any.whl Binary files differindex 15787c59..fd3f48d1 100644 --- a/extension/scripts/continuedev-0.1.0-py3-none-any.whl +++ b/extension/scripts/continuedev-0.1.0-py3-none-any.whl diff --git a/extension/scripts/install_from_source.py b/extension/scripts/install_from_source.py new file mode 100644 index 00000000..bbb86797 --- /dev/null +++ b/extension/scripts/install_from_source.py @@ -0,0 +1,63 @@ +import os +import subprocess + + +def run(cmd: str): + return subprocess.run(cmd, shell=True, capture_output=False) + + +def main(): + # Check for Python and Node - we won't install them, but will warn + resp1 = run("python --version") + resp2 = run("python3 --version") + if resp1.stderr and resp2.stderr: + print("Python is required for Continue but is not installed on your machine. See https://www.python.org/downloads/ to download the latest version, then try again.") + return + + resp = run("node --version") + if resp.stderr: + print("Node is required for Continue but is not installed on your machine. See https://nodejs.org/en/download/ to download the latest version, then try again.") + return + + resp = run("npm --version") + if resp.stderr: + print("NPM is required for Continue but is not installed on your machine. See https://nodejs.org/en/download/ to download the latest version, then try again.") + return + + resp = run("poetry --version") + if resp.stderr: + print("Poetry is required for Continue but is not installed on your machine. See https://python-poetry.org/docs/#installation to download the latest version, then try again.") + return + + resp = run("cd ../../continuedev; poetry install; poetry run typegen") + + resp = run( + "cd ..; npm i; cd react-app; npm i; cd ..; npm run full-package") + + if resp.stderr: + print("Error packaging the extension. Please try again.") + print("This was the error: ", resp.stderr) + return + + latest = None + latest_major = 0 + latest_minor = 0 + latest_patch = 0 + for file in os.listdir("../build"): + if file.endswith(".vsix"): + version = file.split("-")[1].split(".vsix")[0] + major, minor, patch = list( + map(lambda x: int(x), version.split("."))) + if latest is None or (major >= latest_major and minor >= latest_minor and patch > latest_patch): + latest = file + latest_major = major + latest_minor = minor + latest_patch = patch + + resp = run(f"cd ..; code --install-extension ./build/{latest}") + + print("Continue VS Code extension installed successfully. Please restart VS Code to use it.") + + +if __name__ == "__main__": + main() |