Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions geopyspark/command/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
from os import path
import argparse
import subprocess

from geopyspark.geopyspark_constants import JAR, CWD

Expand All @@ -31,12 +32,14 @@ def write_jar_path(jar_path):
f.write(jar_path)

def download_jar(jar_path):
import subprocess

jar_location = path.join(jar_path, JAR)
write_jar_path(jar_location)

subprocess.call(['curl', '-L', JAR_URL, '-o', jar_location])
print("Downloading", JAR_URL)
# Will raise exception when curl download fails (e.g. 404 not found)
subprocess.check_call(['curl', '-L', '--fail', JAR_URL, '-o', jar_location])
print("Downloaded to", jar_location)

write_jar_path(jar_location)

def get_jar_path():
default_jar_location = path.join(DEFAULT_JAR_PATH, JAR)
Expand Down