File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- : ${1?" Usage: $0 <language>" }
3+ : ${1?" Usage: $0 <server language>" }
44
55set -e
66
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
3- : ${1?" Usage: $0 <language>" }
3+ # ./edit ru <- tutorial language: RU, server: EN
4+ # ./edit ru ru <- tutorial language: RU, server: RU
45
5- BRANCH= " ${1:- $NODE_LANG } "
6+ : ${1? " Usage: $0 <tutorial language> [<server language>] " }
67
7- export NODE_LANG=$BRANCH
8+
9+ export TUTORIAL_ROOT=" ../javascript-tutorial-$1 "
10+ export NODE_LANG=" ${2:- en} "
811export NODE_ENV=production
912export TUTORIAL_EDIT=1
1013export NODE_PRESERVE_SYMLINKS=1
Original file line number Diff line number Diff line change 11@ if " %~1 " == " " goto usage
22
3+ export TUTORIAL_ROOT=" ../javascript-tutorial-%1 "
34@ set NODE_LANG = %1
45@ set NODE_ENV = production
56@ set TUTORIAL_EDIT = 1
@@ -14,4 +15,4 @@ goto :eof
1415
1516:usage
1617echo Usage: %0 < Language>
17- exit /B 1
18+ exit /B 1
Original file line number Diff line number Diff line change @@ -60,11 +60,21 @@ let config = module.exports = {
6060 tmpRoot : path . join ( process . cwd ( ) , 'tmp' ) ,
6161 // js/css build versions
6262 cacheRoot : path . join ( process . cwd ( ) , 'cache' ) ,
63- tutorialGithubBaseUrl : 'https://github.com/iliakan/javascript-tutorial-' + lang + '/tree/master' ,
6463
6564 handlers : require ( './handlers' )
6665} ;
6766
67+ let repos = require ( 'jsengine/koa/tutorial/repos' ) ;
68+ for ( let repo in repos ) {
69+ if ( repos [ repo ] . lang === lang ) {
70+ config . tutorialRepo = {
71+ github : repo ,
72+ branch : repos [ repo ] . branch || 'master' ,
73+ url : new URL ( 'https://github.com/' + repo + '/tree/' + ( repos [ repo ] . branch || 'master' ) )
74+ }
75+ }
76+ }
77+
6878require . extensions [ '.yml' ] = function ( module , filename ) {
6979 module . exports = yaml . safeLoad ( fs . readFileSync ( filename , 'utf-8' ) ) ;
7080} ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments