Skip to content

Commit

Permalink
Merge pull request #14 from jbduncan/windows-and-64-bit-arch-fixes
Browse files Browse the repository at this point in the history
Fix bugs on Windows and 64-bit architectures
  • Loading branch information
philwo authored Dec 16, 2018
2 parents 137b6ad + 40cb2fc commit b672790
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bazelisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def resolve_version_label_to_number(bazelisk_directory, version):


def determine_bazel_filename(version):
machine = platform.machine()
machine = normalized_machine_arch_name()
if machine != 'x86_64':
raise Exception('Unsupported machine architecture "{}". '
'Bazel currently only supports x86_64.'.format(machine))
Expand All @@ -103,7 +103,16 @@ def determine_bazel_filename(version):
'Bazel currently only supports Linux, macOS and Windows.'
.format(operating_system))

return 'bazel-{}-{}-{}'.format(version, operating_system, machine)
filename_ending = '.exe' if operating_system == 'windows' else ''
return 'bazel-{}-{}-{}{}'.format(version, operating_system, machine,
filename_ending)


def normalized_machine_arch_name():
machine = platform.machine().lower()
if machine == 'amd64':
machine = 'x86_64'
return machine


def determine_url(version, bazel_filename):
Expand Down

0 comments on commit b672790

Please sign in to comment.