ProjectSize.js 954 B

1234567891011121314151617181920212223242526
  1. // TODO: This file was created by bulk-decaffeinate.
  2. // Sanity-check the conversion and remove this comment.
  3. // require("coffee-script")
  4. // fs = require("fs")
  5. // _ = require("underscore")
  6. // if not process.argv[2]
  7. // console.log "Usage: coffee project_size.coffee user_files_path"
  8. // else
  9. // dirPath = process.argv[2]
  10. // if not fs.lstatSync(dirPath).isDirectory()
  11. // console.log dirPath + " directory not exist"
  12. // else
  13. // fs.readdir dirPath, (err, files)->
  14. // projects = []
  15. // files.forEach (file)->
  16. // project_id = file.split("_")[0]
  17. // if !projects[project_id]
  18. // projects[project_id] = 0
  19. // projects[project_id] += fs.lstatSync(dirPath+"/"+file).size
  20. // ids = _.keys projects
  21. // console.log "project \t size"
  22. // ids.forEach (id)->
  23. // console.log id + "\t" + projects[id]