Copy given files to dist directory
965492
function copyToDist(srcArr) {
  return gulp.src(srcArr.concat(globalExcludes))
    .pipe(gulp.dest(function (file) {
      return libraryDist + file.base.slice(__dirname.length); // save directly to dist
    }));
}
172046
function copyFiles(dir) {
    var files = fs.readdirSync(srcDir + dir);
    files.forEach(function(file) {
      var currentDir = dir + file;
      if (!regexExcludeFiles.test(currentDir)) {
        var stats = fs.statSync(srcDir + currentDir);
        if (stats.isDirectory()) {
          if (!fs.existsSync(publishDir + currentDir)) {
            fs.mkdirSync(publishDir + currentDir);
          }
          copyFiles(currentDir + "/");
        } else if (stats.isFile()) {
          var contents = fs.readFileSync(srcDir + currentDir);
          fs.writeFileSync(publishDir + currentDir, contents);
        }
      }
    });
  }
396715
def copydir(orig, dest):
    

    copied = list()

    makedirsp(dest)

    for root, dirs, files in walk(orig):
        for d in dirs:
            # ensure directories exist
            makedirsp(join(dest, d))

        for f in files:
            root_f = join(root, f)
            dest_f = join(dest, relpath(root_f, orig))
            copy(root_f, dest_f)
            copied.append((root_f, dest_f))

    return copied
875903
function(cb_) {
    fs.copy(path.join(__dirname, './LINUX_README'), 
            path.join(tmp_dist_path, 'README'), cb_);
  }
283487
function copySchemaFiles() {
    const resolvedSrcSchemaPaths = path.resolve(rootDir, srcSchemaPaths);

    glob(resolvedSrcSchemaPaths, void(0), function(error, files) {
        files.forEach((filePath) => {
        const destSchemaPath = filePath.replace(/(\bsrc\b)(?!.*\1)/, destDir);
            fs.copyFileSync(filePath, destSchemaPath);
        });
    });
}
982563
def copy2(src, dst):
    
    if os.path.isdir(dst):
        dst = os.path.join(dst, os.path.basename(src))
    copyfile(src, dst)
    copystat(src, dst)
156396
private void copyBaseDirs(File[] baseDirs) {
        this.baseDirs = new File[baseDirs.length];
        for (int i = 0; i < baseDirs.length; i++) {
            this.baseDirs[i] = baseDirs[i].getAbsoluteFile();
        }
    }
1164175
def _tar_and_copy(src_dir, target_dir):
  """"""
  src_dir = src_dir.rstrip("/")
  target_dir = target_dir.rstrip("/")
  tmp_dir = tempfile.gettempdir().rstrip("/")
  src_base = os.path.basename(src_dir)
  shell_run(
      "tar --exclude=.git -zcf {tmp_dir}/{src_base}.tar.gz -C {src_dir} .",
      src_dir=src_dir,
      src_base=src_base,
      tmp_dir=tmp_dir)
  final_destination = "%s/%s.tar.gz" % (target_dir, src_base)
  shell_run(
      ("gsutil cp {tmp_dir}/{src_base}.tar.gz "
       "{final_destination}"),
      tmp_dir=tmp_dir,
      src_base=src_base,
      final_destination=final_destination)
  return final_destination
663155
def _get_files_to_lint(self, external_directories):
        """"""
        all_f = []

        for external_dir in external_directories:
            all_f.extend(_all_files_matching_ext(external_dir, "py"))

        packages = self.distribution.packages or list()
        for package in packages:
            all_f.extend(_all_files_matching_ext(package, "py"))

        py_modules = self.distribution.py_modules or list()
        for filename in py_modules:
            all_f.append(os.path.realpath(filename + ".py"))

        all_f.append(os.path.join(os.getcwd(), "setup.py"))

        # Remove duplicates which may exist due to symlinks or repeated
        # packages found by /setup.py
        all_f = list(set([os.path.realpath(f) for f in all_f]))

        exclusions = [
            "*.egg/*",
            "*.eggs/*"
        ] + self.exclusions
        return sorted([f for f in all_f if not _is_excluded(f, exclusions)])
1173354
async function copy(src, dist) {
    let stats = await stat(src),
        files;

    // 处理文件
    if (!stats.isDirectory()) {
        return await copyFile(src, dist);
    }

    // 生成目标路径
    if (!await stat(dist)) {
        await local.mkdir(dist);
    }

    // 读取文件夹
    files = await local.readdir(src);

    // 处理文件
    await Promise.all(files.map(file => (
        file === 'node_modules' ? Promise.resolve() : copy(path.resolve(src, file), path.resolve(dist, file))
    )));
}
886788
function copyDirSync(src, dest) {
  if (fs.lstatSync(src).isDirectory()) {
    const files = fs.readdirSync(src);
    files.forEach((file) => {
      const curSource = path.join(src, file);
      const curDest = path.join(dest, file);
      if (fs.lstatSync(curSource).isDirectory()) {
        if (!fs.existsSync(curDest)) {
          createDir(curDest);
        }
        copyDirSync(curSource, curDest);
      } else {
        copyFileSync(curSource, curDest);
      }
    });
  }
}
888640
def build(force):
    
    dist_path = Path(DIST_PATH)
    if dist_path.exists() and list(dist_path.glob('*')):
        if force or click.confirm('{} is not empty - delete contents?'.format(dist_path)):
            dist_path.rename(DIST_PATH_DELETE)
            shutil.rmtree(Path(DIST_PATH_DELETE))
            dist_path.mkdir()
        else:
            click.echo('Aborting')
            sys.exit(1)

    subprocess.check_call(['python', 'setup.py', 'bdist_wheel'])
    subprocess.check_call(['python', 'setup.py', 'sdist',
                           '--formats=gztar'])
400686
def upload(ctx, release, rebuild):
    
    dist_path = Path(DIST_PATH)
    if rebuild is False:
        if not dist_path.exists() or not list(dist_path.glob('*')):
            print("No distribution files found. Please run 'build' command first")
            return
    else:
        ctx.invoke(build, force=True)

    if release:
        args = ['twine', 'upload', 'dist/*']
    else:
        repository = 'https://test.pypi.org/legacy/'
        args = ['twine', 'upload', '--repository-url', repository, 'dist/*']

    env = os.environ.copy()

    p = subprocess.Popen(args, env=env)
    p.wait()
429308
function copyFile(src, dest) {
      var content = fs.readFileSync(src, 'binary');
      fs.writeFileSync(dest, content, 'binary');
    }
690572
def copy_tree(src, dst):
    """"""
    for root, subdirs, files in os.walk(src):
        current_dest = root.replace(src, dst)
        if not os.path.exists(current_dest):
            os.makedirs(current_dest)
        for f in files:
            shutil.copy(os.path.join(root, f), os.path.join(current_dest, f))
466101
function copyFile(src, dist, callback) {
    let rs = fs.createReadStream(src),
        ws = fs.createWriteStream(dist);

    // 监听事件
    rs.on('error', callback);
    ws.on('error', callback);
    ws.on('close', callback);

    // 传输文件
    rs.pipe(ws);
}
131124
def copy_files(filelist, destdir):
    
    for filename in filelist:
        destfile = os.path.join(destdir, filename)
        # filename should not be absolute, but let's double-check
        assert destfile.startswith(destdir + os.path.sep)
        destfiledir = os.path.dirname(destfile)
        if not os.path.isdir(destfiledir):
            os.makedirs(destfiledir)
        if os.path.isdir(filename):
            os.mkdir(destfile)
        else:
            shutil.copy2(filename, destfile)