1- var path = require ( 'path' )
2- var getFile = require ( './get-file' )
3- var compare = require ( './compare-solution' )
1+ const path = require ( 'path' )
2+ const getFile = require ( './get-file' )
3+ const compare = require ( './compare-solution' )
44
55module . exports = function createProblem ( dirname ) {
6- var exports = { }
6+ const exports = { }
77
8- var problemName = dirname . split ( path . sep )
9- var i18n
8+ let problemName = dirname . split ( path . sep )
9+ let i18n
1010
1111 problemName = problemName [ problemName . length - 1 ]
1212
1313 exports . init = function ( workshopper ) {
1414 i18n = workshopper . i18n
15- var postfix = workshopper . i18n . lang ( ) === 'en' ? '' : '_' + workshopper . i18n . lang ( )
15+ const postfix = workshopper . i18n . lang ( ) === 'en' ? '' : '_' + workshopper . i18n . lang ( )
1616 this . problem = { file : path . join ( dirname , 'problem' + postfix + '.md' ) }
1717 this . solution = { file : path . join ( dirname , 'solution' + postfix + '.md' ) }
1818 this . solutionPath = path . resolve ( __dirname , '..' , 'solutions' , problemName , 'index.js' )
1919 this . troubleshootingPath = path . join ( __dirname , '..' , 'i18n' , 'troubleshooting' + postfix + '.md' )
2020 }
2121
2222 exports . verify = function ( args , cb ) {
23- var attemptPath = path . resolve ( process . cwd ( ) , args [ 0 ] )
23+ const attemptPath = path . resolve ( process . cwd ( ) , args [ 0 ] )
2424 compare ( this . solutionPath , attemptPath , i18n , function ( _ , match , obj ) {
2525 if ( match ) {
2626 return cb ( null , true )
@@ -31,7 +31,7 @@ module.exports = function createProblem (dirname) {
3131 return
3232 }
3333
34- var message = getFile ( this . troubleshootingPath )
34+ let message = getFile ( this . troubleshootingPath )
3535
3636 message = message . replace ( / % s o l u t i o n % / g, obj . solution )
3737 message = message . replace ( / % a t t e m p t % / g, obj . attempt )
0 commit comments