     union_package_index = re_dir.length
     delete re_dir.length
 
+    console.log re_dir
     for key, value of re_dir
       if value.length isnt 0
         create_adapter_zip(key, value)

    tmp_file_name = path.join f_name, path.basename(path.dirname tmp_file), tmp_file_name
    console.log tmp_file_name
    zip.addFile(tmp_file_name, tmp_file)
  if sync_flag
    union_package_pkgs.push(re_pa)
    zip.saveAs(re_pa, () ->
      union_package_index-=1
      #  console.log union_package_index
      if union_package_index is 0
        common_zip(union_package_pkgs, emp.ADAPTER_UNION_PACKAGE_NAME)
      console.log "zip written."
      )
  else
    zip.saveAs(re_pa, () ->
      union_package_index-=1
      if union_package_index is 0
        emp.show_info emp.EMP_PACKAGE_PKG_SUCCESS
      console.log "zip written."
      )
  re_pa


common_zip = (file_list, zip_name = emp.DEFAULT_ZIP_FULE_NAME) ->
  project_path = atom.project.getPath()
  tmp_path = path.join project_path, "tmp"
  re_pa = path.join tmp_path, zip_name

  zip = new ZipWriter()
  for tmp_file in file_list
    tmp_file_name = path.basename tmp_file
    # tmp_dir_name = path.dirname tmp_file
    # tmp_file_name = path.join path.basename(path.dirname tmp_file), tmp_file_name
    zip.addFile(tmp_file_name, tmp_file)
  zip.toBuffer((buf) ->
    )

  zip.saveAs(re_pa, () ->
     console.log "zip written."

  emp.mkdir_sync tmp_path
  package_type.split("/").join(".")

  f_name = ([emp.ADAPTER_PACKAGE_HEAD].concat package_type.split("/")).join(".")
  fe_name = f_name + ".zip"
  re_pa = path.join tmp_path, fe_name
  zip = new ZipWriter()
