Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jan
kresus
Commits
bff2288b
Commit
bff2288b
authored
Aug 29, 2016
by
ZeHiro
Browse files
Add script to check the presence of logo for all the banks
parent
082ffdbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/check-logos.js
0 → 100644
View file @
bff2288b
/* eslint no-process-exit: 0 */
import
*
as
path
from
'
path-extra
'
;
import
*
as
fs
from
'
fs
'
;
import
banks
from
'
../shared/banks.json
'
;
let
log
=
require
(
'
printit
'
)({
prefix
:
'
check-logos
'
});
let
imagesDir
=
path
.
join
(
path
.
dirname
(
fs
.
realpathSync
(
__filename
)),
'
..
'
,
'
static
'
,
'
images
'
,
'
banks
'
);
let
allLogoHere
=
true
;
for
(
let
bank
of
banks
)
{
try
{
let
imagePath
=
path
.
join
(
imagesDir
,
`
${
bank
.
uuid
}
.png`
);
fs
.
accessSync
(
imagePath
,
fs
.
F_OK
);
}
catch
(
e
)
{
log
.
error
(
`
${
bank
.
uuid
}
: there is no logo for this module/bank`
);
allLogoHere
=
false
;
}
}
if
(
!
allLogoHere
)
{
process
.
exit
(
1
);
}
log
.
info
(
'
CheckLogos: OK.
'
);
process
.
exit
(
0
);
scripts/test.sh
View file @
bff2288b
...
...
@@ -4,6 +4,8 @@
./scripts/lint.sh ./
&&
\
# Compare locales
./node_modules/babel-cli/bin/babel-node.js
--presets
es2015 ./scripts/compare-locales.js
&&
\
# Check all banks have a logo
./node_modules/babel-cli/bin/babel-node.js
--presets
es2015 ./scripts/check-logos.js
&&
\
# Run proper tests
./node_modules/mocha/bin/mocha ./tests/
--recursive
--require
babel-register
&&
\
# Add new tests here
...
...
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