Skip to content

Commit 3c92486

Browse files
committed
jsengine to symlinks optionally
1 parent 8210bd8 commit 3c92486

6 files changed

Lines changed: 21 additions & 11 deletions

File tree

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
: ${1?"Usage: $0 <language>"}
3+
: ${1?"Usage: $0 <server language>"}
44

55
set -e
66

edit

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
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}"
811
export NODE_ENV=production
912
export TUTORIAL_EDIT=1
1013
export NODE_PRESERVE_SYMLINKS=1

edit.cmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
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
1617
echo Usage: %0 <Language>
17-
exit /B 1
18+
exit /B 1

modules/config/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
6878
require.extensions['.yml'] = function(module, filename) {
6979
module.exports = yaml.safeLoad(fs.readFileSync(filename, 'utf-8'));
7080
};

modules/jsengine

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)