``` @memoized_property def base_dir(self): ...
# general
b
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')