{"size": 474, "ext": "js", "max_stars_repo_path": "renderer/src/componets/FileExplorer/processor/softRemoveFolder.js", "max_stars_repo_name": "Linsenx/Ocelot-Coding", "max_stars_repo_stars_event_min_datetime": "2020-06-30T15:03:01.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-20T09:36:52.000Z", "max_issues_repo_path": "renderer/src/componets/FileExplorer/processor/softRemoveFolder.js", "max_issues_repo_name": "NightCats/Ocelot-Coding", "max_issues_repo_issues_event_min_datetime": "2020-06-30T01:25:23.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-25T18:55:52.000Z", "max_forks_repo_path": "renderer/src/componets/FileExplorer/processor/softRemoveFolder.js", "max_forks_repo_name": "NightCats/Ocelot-Coding", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 22.5714285714, "max_line_length": 69, "alphanum_fraction": 0.6265822785}
const fs = window.require('fs')
const path = window.require('path')
import { trashbinPath } from '../../../utils/oceFolderInitialization'

export default oldpath => {
  try {
    const foldername = path
      .resolve(oldpath)
      .split(path.sep)
      .pop()
    if (foldername === 'project') {
      return false
    }
    const newpath = path.resolve(trashbinPath, foldername)
    fs.renameSync(oldpath, newpath)
    return true
  } catch (e) {
    return false
  }
}
