Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
30cec291
Commit
30cec291
authored
Jan 21, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
even more stable
parent
6c0ad4b5
Pipeline
#535
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
index.js
bin/index.js
+6
-16
No files found.
bin/index.js
View file @
30cec291
...
...
@@ -16,7 +16,6 @@ const options = yargs
.
option
(
"v"
,
{
alias
:
"verbose"
,
describe
:
"print log"
,
type
:
"boolean"
})
.
option
(
"n"
,
{
alias
:
"nolog"
,
describe
:
"no text log in object"
,
type
:
"boolean"
})
.
option
(
"d"
,
{
alias
:
"dir"
,
describe
:
"database dir"
,
type
:
"string"
})
.
option
(
"f"
,
{
alias
:
"fake"
,
describe
:
"add fake images"
,
type
:
"boolean"
})
.
option
(
"c"
,
{
alias
:
"category"
,
describe
:
"1 - product, 2 - standard"
,
type
:
"string"
})
.
option
(
"i"
,
{
alias
:
"id"
,
describe
:
"return question with id. use it with `seed` arg"
,
type
:
"number"
})
...
...
@@ -84,17 +83,18 @@ try{
throw
new
Error
(
e
)
}
//console.log(options);
data
.
after
=
function
(
skipInit
){
if
(
options
.
list
){
data
.
after
=
function
(
inComeData
,
skipInit
){
if
(
inComeData
){
ctx
.
initDataProvider
(
data
);
}
if
(
options
.
list
&&
!
skipInit
){
var
c
=
options
.
list
,
origI
=
options
.
i
|
0
;
options
.
list
=
false
;
for
(
var
i
=
0
;
i
<
c
;
i
++
){
options
.
i
=
origI
+
i
;
console
.
log
(
`Question `
+
(
options
.
i
+
1
));
data
.
after
(
true
);
data
.
after
(
void
0
,
true
);
console
.
log
(
''
);
}
...
...
@@ -155,16 +155,6 @@ data.after = function(skipInit){
}
if
(
options
.
fake
){
for
(
var
i
=
0
;
i
<
10
;
i
++
){
rand
(
Object
.
values
(
data
.
products
)).
image
=
'https://robohash.org/'
+
seeded
.
toString
(
36
)
}
}
if
(
!
skipInit
){
ctx
.
initDataProvider
(
data
);
}
let
result
;
if
(
options
.
category
===
1
){
...
...
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