Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
e04dfff8
Commit
e04dfff8
authored
Jun 14, 2018
by
Tim Zallmann
Committed by
Lukas Eipert
Jun 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the searching on the whole disk :-P
parent
930baeb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
scripts/frontend/prettier.js
scripts/frontend/prettier.js
+6
-3
No files found.
scripts/frontend/prettier.js
View file @
e04dfff8
...
@@ -10,7 +10,7 @@ const mode = process.argv[2] || 'check';
...
@@ -10,7 +10,7 @@ const mode = process.argv[2] || 'check';
const
shouldSave
=
mode
===
'
save
'
||
mode
===
'
save-all
'
;
const
shouldSave
=
mode
===
'
save
'
||
mode
===
'
save-all
'
;
const
allFiles
=
mode
===
'
check-all
'
||
mode
===
'
save-all
'
;
const
allFiles
=
mode
===
'
check-all
'
||
mode
===
'
save-all
'
;
let
dirPath
=
process
.
argv
[
3
]
||
''
;
let
dirPath
=
process
.
argv
[
3
]
||
''
;
if
(
dirPath
.
charAt
(
dirPath
.
length
-
1
)
!==
'
/
'
)
dirPath
+=
'
/
'
;
if
(
dirPath
&&
dirPath
.
charAt
(
dirPath
.
length
-
1
)
!==
'
/
'
)
dirPath
+=
'
/
'
;
const
config
=
{
const
config
=
{
patterns
:
[
'
**/*.js
'
,
'
**/*.vue
'
,
'
**/*.scss
'
],
patterns
:
[
'
**/*.js
'
,
'
**/*.vue
'
,
'
**/*.scss
'
],
...
@@ -43,7 +43,8 @@ const availableExtensions = Object.keys(config.parsers);
...
@@ -43,7 +43,8 @@ const availableExtensions = Object.keys(config.parsers);
console
.
log
(
`Loading
${
allFiles
?
'
All
'
:
'
Selected
'
}
Files ...`
);
console
.
log
(
`Loading
${
allFiles
?
'
All
'
:
'
Selected
'
}
Files ...`
);
const
stagedFiles
=
allFiles
||
dirPath
?
null
:
getStagedFiles
(
availableExtensions
.
map
(
ext
=>
`*.
${
ext
}
`
));
const
stagedFiles
=
allFiles
||
dirPath
?
null
:
getStagedFiles
(
availableExtensions
.
map
(
ext
=>
`*.
${
ext
}
`
));
if
(
stagedFiles
)
{
if
(
stagedFiles
)
{
if
(
!
stagedFiles
.
length
||
(
stagedFiles
.
length
===
1
&&
!
stagedFiles
[
0
]))
{
if
(
!
stagedFiles
.
length
||
(
stagedFiles
.
length
===
1
&&
!
stagedFiles
[
0
]))
{
...
@@ -64,7 +65,9 @@ if (allFiles) {
...
@@ -64,7 +65,9 @@ if (allFiles) {
files
=
glob
.
sync
(
globPattern
,
{
ignore
}).
filter
(
f
=>
allFiles
||
stagedFiles
.
includes
(
f
));
files
=
glob
.
sync
(
globPattern
,
{
ignore
}).
filter
(
f
=>
allFiles
||
stagedFiles
.
includes
(
f
));
}
else
if
(
dirPath
)
{
}
else
if
(
dirPath
)
{
const
ignore
=
config
.
ignore
;
const
ignore
=
config
.
ignore
;
const
patterns
=
config
.
patterns
.
map
((
item
)
=>
{
return
dirPath
+
item
;});
const
patterns
=
config
.
patterns
.
map
(
item
=>
{
return
dirPath
+
item
;
});
const
globPattern
=
patterns
.
length
>
1
?
`{
${
patterns
.
join
(
'
,
'
)}
}`
:
`
${
patterns
.
join
(
'
,
'
)}
`
;
const
globPattern
=
patterns
.
length
>
1
?
`{
${
patterns
.
join
(
'
,
'
)}
}`
:
`
${
patterns
.
join
(
'
,
'
)}
`
;
files
=
glob
.
sync
(
globPattern
,
{
ignore
});
files
=
glob
.
sync
(
globPattern
,
{
ignore
});
}
else
{
}
else
{
...
...
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