Copies the version into the given directory

 @param version [Semverse::Version] The version
 @param directory [Pathname] The pathname

 @return nil
960433
def copy_to(version, directory)
      # Delete the directory to make sure no pervious version remains if
      # we are using a branch or symlink if using Dir.
      FileUtils.rm_rf(directory) if directory.exist?

      # Create directory if not exists
      FileUtils.mkdir_p directory

      # Copy hole repository
      FileUtils.cp_r("#{fetch(version).path}/.", directory)

      # Remove .git directory
      FileUtils.rm_rf(File.join(directory, '.git'))

      nil
    end
623144
def repo_clone(from_name, to_name)
      Dir.chdir(tmp_repos_path) { `git clone #{from_name} #{to_name} 2>&1 > /dev/null` }
      repo_path(to_name)
    end
1079662
function saveNewVersion(version, versionFile) {
    fs.writeFileSync(versionFile, JSON.stringify({
        version
    }, null, 2), 'UTF-8');
}
232155
def current_command_version
      output = command('version', [], false)
      version = output[/\d+\.\d+(\.\d+)+/]
      version.split('.').collect {|i| i.to_i}
    end
124735
def write(version):
    # type: (str) -> None
    
    if not is_valid(version):
        raise ValueError("Invalid version: ".format(version))

    storage = get_version_storage()
    storage.write(version)
867385
def yank_version(name, version, options = {})
      ensure_ready!(:authorization)
      url = "gems/#{escape(name)}/versions/#{escape(version)}"
      response = connection.delete(url, options)
      checked_response_body(response)
    end
752196
public static void copyDir(File from, File to) throws FileNotFoundException, IOException {
        File[] files = from.listFiles();

        if (files != null) {
            for (File ff : files) {
                File tf = new File(to, ff.getName());
                if (ff.isDirectory()) {
                    if (tf.mkdir()) {
                        copyDir(ff, tf);
                    }
                } else if (ff.isFile()) {
                    copyFile(tf, ff);
                }
            }
        }
    }
1283962
def get_version(path = Dir.pwd, options = {})
      rootdir = normalized_path(path)
      version = (options[:default]) ? options[:default] : FalkorLib.config[:versioning][:default]
      type    = (options[:type])    ? options[:type]    : FalkorLib.config[:versioning][:type]
      source  = (options[:source])  ? options[:source]  : FalkorLib.config[:versioning][:source][ type ]
      puts "type = '#{type}'"
      case type
      when 'file'
        versionfile = File.join( rootdir, source[:filename] )
        puts "versionfile = '#{versionfile}'"
        version = File.read( versionfile ).chomp if File.exist?( versionfile )
      when 'gem'
        getmethod = source[:getmethod ]
        version = eval( getmethod ) unless (getmethod.nil? || getmethod.empty?)
      when 'puppet_module'
        jsonfile = File.join( rootdir, source[:filename] )
        metadata = JSON.parse( IO.read( jsonfile ) )
        version  = metadata["version"]
      end
      version
    end
918206
def copy(destination: site.path, mirror: false)
      fail 'Must specify a destination' if destination.nil?
      exclude = options[:copy_exclude]
      exclude.concat config[:persistent] unless config[:persistent].nil?
      Utils.copy_directory directory, destination, exclude: exclude, mirror: mirror
      self
    end
422057
protected Path getPathForURI(Path fsSpecStoreDirPath, URI uri, String version) {
    return PathUtils.addExtension(PathUtils.mergePaths(fsSpecStoreDirPath, new Path(uri)), version);
  }
446945
def setVersion(self, version):
        
        try:
            sha = self.versions(version).commit.sha
            self.git.reset("--hard", sha)
        except Exception, e:
            raise RepoError(e)
361224
def copy(src, dst):
    
    if os.path.isdir(dst):
        dst = os.path.join(dst, os.path.basename(src))
    copyfile(src, dst)
    copymode(src, dst)
1081466
def clone_or_update
      if File.directory?(@dir + "/.git")
        if Git.open(@dir).remote.url == @config.repository_url
          update
        else
          clone
        end
      else
        clone
      end

      @repo.checkout(@config.branch)
    end
357460
def copy_file_if_missing(file, to_directory)
      unless File.exists? File.join(to_directory, File.basename(file))
        FileUtils.cp(file, to_directory)
      end
    end
1337573
def update!
      ensure_remotes_directory
      dirty_remotes.each do |_name, remote|
        dir = workspace_of(remote)
        if remote[:path] || path_enabled?(remote)
          if symlink?(dir)
            delete_symlink(dir)
          else
            FileUtils.rm_rf(dir) if File.exist?(dir)
          end
        end
        if remote[:path]
          create_symlink(remote[:path], dir)
        else
          rc_url = remote[:rc_url] || remote[:vault]
          tag = remote[:tag].nil? ? Origen::VersionString.new(remote[:version]) : Origen::VersionString.new(remote[:tag])
          version_file = dir.to_s + '/.current_version'
          begin
            if File.exist?("#{dir}/.initial_populate_successful")
              FileUtils.rm_f(version_file) if File.exist?(version_file)
              rc = RevisionControl.new remote: rc_url, local: dir
              rc.send rc.remotes_method, version: prefix_tag(tag), force: true
              File.open(version_file, 'w') do |f|
                f.write tag
              end
            else
              rc = RevisionControl.new remote: rc_url, local: dir
              rc.send rc.remotes_method, version: prefix_tag(tag), force: true
              FileUtils.touch "#{dir}/.initial_populate_successful"
              File.open(version_file, 'w') do |f|
                f.write tag
              end
            end
          rescue Origen::GitError, Origen::DesignSyncError, Origen::PerforceError  => e
            # If Git failed in the remote, its usually easy to see what the problem is, but now *where* it is.
            # This will prepend the failing remote along with the error from the revision control system,
            # then rethrow the error
            e.message.prepend "When updating remotes for #{remote[:importer].name}: "
            raise e
          end
        end
      end
    end
830007
def set_version(self, version):
        
        self.parser.add_argument(
            "--version",
            action="version",
            version="%(prog)s {} (core {})".format(
                version, devpipeline_core.version.STRING
            ),
        )
802892
def copy_dir(src, dst):
   
   try:
      debug.log("copy dir from "+ src, "to "+ dst)
      shutil.copytree(src, dst)
   except Exception as e:
      debug.log("Error: happened while copying!\n%s\n"%e)