Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
overleaf
Commits
59f312fb
Commit
59f312fb
authored
Nov 03, 2016
by
Henry Oswald
Committed by
GitHub
Nov 03, 2016
Browse files
comment out project size for test
parent
20a2b302
Changes
1
Hide whitespace changes
Inline
Side-by-side
grunt/ProjectSize.coffee
View file @
59f312fb
require
(
"coffee-script"
)
#
require("coffee-script")
fs
=
require
(
"fs"
)
_
=
require
(
"underscore"
)
#
fs = require("fs")
#
_ = require("underscore")
if
not
process
.
argv
[
2
]
console
.
log
"Usage: coffee project_size.coffee user_files_path"
else
dirPath
=
process
.
argv
[
2
]
if
not
fs
.
lstatSync
(
dirPath
).
isDirectory
()
console
.
log
dirPath
+
" directory not exist"
else
fs
.
readdir
dirPath
,
(
err
,
files
)
->
projects
=
[]
files
.
forEach
(
file
)
->
project_id
=
file
.
split
(
"_"
)[
0
]
if
!
projects
[
project_id
]
projects
[
project_id
]
=
0
projects
[
project_id
]
+=
fs
.
lstatSync
(
dirPath
+
"/"
+
file
).
size
#
if not process.argv[2]
#
console.log "Usage: coffee project_size.coffee user_files_path"
#
else
#
dirPath = process.argv[2]
#
if not fs.lstatSync(dirPath).isDirectory()
#
console.log dirPath + " directory not exist"
#
else
#
fs.readdir dirPath, (err, files)->
#
projects = []
#
files.forEach (file)->
#
project_id = file.split("_")[0]
#
if !projects[project_id]
#
projects[project_id] = 0
#
projects[project_id] += fs.lstatSync(dirPath+"/"+file).size
ids
=
_
.
keys
projects
console
.
log
"project
\t
size"
ids
.
forEach
(
id
)
->
console
.
log
id
+
"
\t
"
+
projects
[
id
]
#
ids = _.keys projects
#
console.log "project \t size"
#
ids.forEach (id)->
#
console.log id + "\t" + projects[id]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment