Create dist/ if necessary
768119
function (callback) {
		fs.mkdir("./dist", function (err) {
			if (err && err.code !== "EEXIST") {
				callback(err);
				return;
			}

			callback(null);
		});
	}
1039664
def build_distribution():
    """"""
    result = invoke.run('python setup.py sdist bdist_egg bdist_wheel',
                        warn=True, hide=True)
    if result.ok:
        print("[{}GOOD{}] Distribution built without errors."
              .format(GOOD_COLOR, RESET_COLOR))
    else:
        print('[{}ERROR{}] Something broke trying to package your '
              'code...'.format(ERROR_COLOR, RESET_COLOR))
        print(result.stderr)
        sys.exit(1)
636664
def _create_dist(self,
                   dist_tgt,
                   dist_target_dir,
                   setup_requires_pex,
                   snapshot_fingerprint,
                   is_platform_specific):
    """"""
    self._copy_sources(dist_tgt, dist_target_dir)

    setup_py_snapshot_version_argv = self._generate_snapshot_bdist_wheel_argv(
      snapshot_fingerprint, is_platform_specific)

    cmd = safe_shlex_join(setup_requires_pex.cmdline(setup_py_snapshot_version_argv))
    with self.context.new_workunit('setup.py', cmd=cmd, labels=[WorkUnitLabel.TOOL]) as workunit:
      with pushd(dist_target_dir):
        result = setup_requires_pex.run(args=setup_py_snapshot_version_argv,
                                        stdout=workunit.output('stdout'),
                                        stderr=workunit.output('stderr'))
        if result != 0:
          raise self.BuildLocalPythonDistributionsError(
            "Installation of python distribution from target {target} into directory {into_dir} "
            "failed (return value of run() was: {rc!r}).\n"
            "The pex with any requirements is located at: {interpreter}.\n"
            "The host system's compiler and linker were used.\n"
            "The setup command was: {command}."
            .format(target=dist_tgt,
                    into_dir=dist_target_dir,
                    rc=result,
                    interpreter=setup_requires_pex.path(),
                    command=setup_py_snapshot_version_argv))
613308
def check_nsp(dist, attr, value):
    """"""
    ns_packages = value
    assert_string_list(dist, attr, ns_packages)
    for nsp in ns_packages:
        if not dist.has_contents_for(nsp):
            raise DistutilsSetupError(
                "Distribution contains no modules or packages for " +
                "namespace package %r" % nsp
            )
        parent, sep, child = nsp.rpartition('.')
        if parent and parent not in ns_packages:
            distutils.log.warn(
                "WARNING: %r is declared as a package namespace, but %r"
                " is not: please correct this in setup.py", nsp, parent
            )
521129
def _makeBaseDir(basedir, quiet):
    
    if os.path.exists(basedir):
        if not quiet:
            print("updating existing installation")
        return

    if not quiet:
        print("mkdir", basedir)

    try:
        os.mkdir(basedir)
    except OSError as exception:
        raise CreateWorkerError("error creating directory {0}: {1}".format(
                                basedir, exception.strerror))
787367
def install(cls):
        """"""
        [os.makedirs('{}/{}'.format(cls.home, cls.dirs[d])) for d in cls.dirs]
1179705
def distro_check():
    """"""
    distro_data = platform.linux_distribution()
    distro = [d.lower() for d in distro_data if d.isalpha()]

    if any(['ubuntu' in distro, 'debian' in distro]) is True:
        return 'apt'
    elif any(['centos' in distro, 'redhat' in distro]) is True:
        return 'yum'
    elif any(['suse' in distro]) is True:
        return 'zypper'
    else:
        raise AssertionError(
            'Distro [ %s ] is unsupported.' % distro
        )
1334275
function create(con, p, cb) {
  var data = 'created by zk-mkdir-p'; // just want a dir, so store something
  var flags = 0; // none
  con.a_create(p, data, flags, function(rc, error, zkPath) {
    // already exists, cool.
    if(rc == ZooKeeper.ZNODEEXISTS) {
      return cb();
    }
    if(rc != 0) {
      return cb(new Error('Zookeeper Error: code='+rc+'   '+error));
    }
    // sucessfully created!
    return cb();
  });
}
913509
def make_dir(self):
        """"""
        if not os.path.exists(self.dirname):
            os.makedirs(self.dirname)
3210
def _get_whl_from_dir(cls, install_dir):
    """"""
    dist_dir = cls._get_dist_dir(install_dir)
    dists = glob.glob(os.path.join(dist_dir, '*.whl'))
    if len(dists) == 0:
      raise cls.BuildLocalPythonDistributionsError(
        'No distributions were produced by python_create_distribution task.\n'
        'dist_dir: {}, install_dir: {}'
        .format(dist_dir, install_dir))
    if len(dists) > 1:
      # TODO: is this ever going to happen?
      raise cls.BuildLocalPythonDistributionsError('Ambiguous local python distributions found: {}'
                                                   .format(dists))
    return dists[0]
1136555
def _dist_wrapper():
    """"""
    try:
        # Copy select *.rst files to *.txt for build.
        for rst_file, txt_file in zip(SDIST_RST_FILES, SDIST_TXT_FILES):
            local("cp %s %s" % (rst_file, txt_file))

        # Perform action.
        yield
    finally:
        # Clean up temp *.txt files.
        for rst_file in SDIST_TXT_FILES:
            local("rm -f %s" % rst_file, capture=False)
592986
def distcheck(appname='',version='',subdir=''):
	''''''
	import tempfile,tarfile
	if not appname:appname=Utils.g_module.APPNAME
	if not version:version=Utils.g_module.VERSION
	waf=os.path.abspath(sys.argv[0])
	tarball=dist(appname,version)
	path=appname+'-'+version
	if os.path.exists(path):
		shutil.rmtree(path)
	t=tarfile.open(tarball)
	for x in t:t.extract(x)
	t.close()
	if subdir:
		build_path=os.path.join(path,subdir)
	else:
		build_path=path
	instdir=tempfile.mkdtemp('.inst','%s-%s'%(appname,version))
	ret=Utils.pproc.Popen([waf,'configure','build','install','uninstall','--destdir='+instdir],cwd=build_path).wait()
	if ret:
		raise Utils.WafError('distcheck failed with code %i'%ret)
	if os.path.exists(instdir):
		raise Utils.WafError('distcheck succeeded, but files were left in %s'%instdir)
	shutil.rmtree(path)
930457
def create_environment(home_dir, site_packages=True, clear=False,
                       unzip_setuptools=False, use_distribute=False):
    
    home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)

    py_executable = os.path.abspath(install_python(
        home_dir, lib_dir, inc_dir, bin_dir,
        site_packages=site_packages, clear=clear))

    install_distutils(lib_dir, home_dir)

    if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'):
        install_distribute(py_executable, unzip=unzip_setuptools)
    else:
        install_setuptools(py_executable, unzip=unzip_setuptools)

    install_pip(py_executable)

    install_activate(home_dir, bin_dir)
35413
function createDir (directoryToCreate) {
  return new Promise((resolve, reject) => {
    mkdirp(directoryToCreate, (err) => {
      if (err) {
        return reject(new Error(err));
      }

      return resolve();
    });
  });
}
464392
def create(ctx, name, integration_type, location, non_interactive, quiet, dry_run):
    """"""
    repo_choice = ctx.obj['repo_choice']
    root = resolve_path(location) if location else get_root()
    path_sep = os.path.sep

    integration_dir = os.path.join(root, normalize_package_name(name))
    if os.path.exists(integration_dir):
        abort('Path `{}` already exists!'.format(integration_dir))

    template_fields = {}
    if repo_choice != 'core' and not non_interactive and not dry_run:
        template_fields['author'] = click.prompt('Your name')
        template_fields['email'] = click.prompt('Your email')
        template_fields['email_packages'] = template_fields['email']
        click.echo()

    config = construct_template_fields(name, repo_choice, **template_fields)

    files = create_template_files(integration_type, root, config, read=not dry_run)
    file_paths = [file.file_path.replace('{}{}'.format(root, path_sep), '', 1) for file in files]

    path_tree = tree()
    for file_path in file_paths:
        branch = path_tree

        for part in file_path.split(path_sep):
            branch = branch[part]

    if dry_run:
        if quiet:
            echo_info('Will create `{}`'.format(integration_dir))
        else:
            echo_info('Will create in `{}`:'.format(root))
            display_path_tree(path_tree)
        return

    for file in files:
        file.write()

    if quiet:
        echo_info('Created `{}`'.format(integration_dir))
    else:
        echo_info('Created in `{}`:'.format(root))
        display_path_tree(path_tree)
504789
def makedirs(name):
    """"""

    import os, errno

    try:
        os.makedirs(name)
    except OSError as ex:
        if ex.errno == errno.EEXIST and os.path.isdir(name):
            # ignore existing directory
            pass
        else:
            # a different error happened
            raise
68392
def main(argv=sys.argv):
    """"""
    parser = setup_parser()

    (opts, args) = parser.parse_args(argv[1:])

    if not args:
        parser.error('A package path is required.')

    rootpath, excludes = args[0], args[1:]
    if not opts.destdir:
        parser.error('An output directory is required.')
    if opts.header is None:
        opts.header = path.normpath(rootpath).split(path.sep)[-1]
    if opts.suffix.startswith('.'):
        opts.suffix = opts.suffix[1:]
    if not path.isdir(rootpath):
        print >>sys.stderr, '%s is not a directory.' % rootpath
        sys.exit(1)
    if not path.isdir(opts.destdir):
        if not opts.dryrun:
            os.makedirs(opts.destdir)
    rootpath = path.normpath(path.abspath(rootpath))
    excludes = normalize_excludes(rootpath, excludes)
    modules = recurse_tree(rootpath, excludes, opts)
    if opts.full:
        from sphinx import quickstart as qs
        modules.sort()
        prev_module = ''
        text = ''
        for module in modules:
            if module.startswith(prev_module + '.'):
                continue
            prev_module = module
            text += '   %s\n' % module
        d = dict(
            path = opts.destdir,
            sep  = False,
            dot  = '_',
            project = opts.header,
            author = opts.author or 'Author',
            version = opts.version or '',
            release = opts.release or opts.version or '',
            suffix = '.' + opts.suffix,
            master = 'index',
            epub = True,
            ext_autodoc = True,
            ext_viewcode = True,
            makefile = True,
            batchfile = True,
            mastertocmaxdepth = opts.maxdepth,
            mastertoctree = text,
        )
        if not opts.dryrun:
            qs.generate(d, silent=True, overwrite=opts.force)
    elif not opts.notoc:
        create_modules_toc_file(modules, opts)