FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit-example/common.js at master · thorgits/nodegit-example · GitHub
thorgits
nodegit-example
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit-example
/
common.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (47 loc) · 1.16 KB
Breadcrumbs
nodegit-example
/
common.js
Copy path
File metadata and controls
56 lines (47 loc) · 1.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'use strict'
;
const
Git
=
require
(
'nodegit'
)
;
const
fs
=
require
(
'fs'
)
;
const
_
=
require
(
'underscore'
)
;
const
cnst
=
require
(
'./constant'
)
;
exports
.
get_commiter_sign
=
(
cnst
)
=>
{
let
timestamp
=
+
new
Date
(
)
;
return
Git
.
Signature
.
create
(
cnst
.
commiter_name
,
cnst
.
commiter_email
,
timestamp
,
60
)
;
}
;
let
pourDummyData
=
function
(
size
)
{
let
dummyData
=
''
;
let
dummyUnit
=
`
HH HH HHHHHHH
HH HH HHH
HH HH HHH
HH HH HHH
HHHHHHHHHH HHH
HHHHHHHHHH HHH
HH HH HHH
HH HH HHH
HH HH HHH
HH HH HHHHHHH
`
;
size
=
size
||
50000
;
for
(
let
i
=
0
;
i
<
size
;
i
++
)
{
dummyData
+=
dummyUnit
;
}
return
dummyData
;
}
;
exports
.
create_files
=
(
dir
,
num
,
timestamp
)
=>
{
let
promises
=
[
]
;
let
dummyData
=
pourDummyData
(
)
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
promises
.
push
(
new
Promise
(
(
resolve
,
reject
)
=>
{
fs
.
mkdirSync
(
`
${
cnst
.
test_file_path
}
${
dir
}
_
${
i
}
_
${
timestamp
}
_tt/`
)
;
fs
.
writeFile
(
`
${
cnst
.
test_file_path
}
${
dir
}
_
${
i
}
_
${
timestamp
}
_tt/
${
timestamp
+
i
}
.html`
,
dummyData
,
(
)
=>
{
resolve
(
`
${
dir
}
_
${
i
}
_
${
timestamp
}
_tt/
${
timestamp
+
i
}
.html`
)
;
}
)
;
}
)
)
;
}
return
Promise
.
all
(
promises
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL