https://pantsbuild.org/ logo
#general
Title
# general
b

bored-art-40741

03/02/2016, 10:12 PM
Copy code
@memoized_property
  def base_dir(self):
    """Returns the base directory for this stack distribution.

    :returns: The stack distribution base directory.
    :rtype: string
    """
    stack_dist = self._binary_util.select_binary(self._relpath, self.version, 'stack.tar.gz')
    distribution_workdir = os.path.dirname(stack_dist)
    outdir = os.path.join(distribution_workdir, 'unpacked')
    if not os.path.exists(outdir):
      with temporary_dir(root_dir=distribution_workdir) as tmp_dist:
        TGZ.extract(stack_dist, tmp_dist)
        os.rename(tmp_dist, outdir)
    return os.path.join(outdir, 'stack')