Skip to content

Commit f3cf738

Browse files
committed
replace '"' to '' for the tutorial path of windows
1 parent 3d1212b commit f3cf738

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

modules/config/index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,34 @@ let config = module.exports = {
3535
host: env.HOST || 'localhost'
3636
},
3737

38-
appKeys: [secret.sessionKey],
38+
appKeys: [secret.sessionKey],
3939
adminKey: secret.adminKey,
4040

4141
certDir: path.join(secret.dir, 'cert'),
42-
43-
lang: lang,
42+
43+
lang: lang,
4444

4545
plnkrAuthId: secret.plnkrAuthId,
4646

4747
assetVersioning: env.ASSET_VERSIONING === 'file' ? 'file' :
48-
env.ASSET_VERSIONING === 'query' ? 'query' : null,
48+
env.ASSET_VERSIONING === 'query' ? 'query' : null,
4949

50-
pug: {
50+
pug: {
5151
basedir: path.join(process.cwd(), 'templates'),
52-
cache: env.NODE_ENV !== 'development'
52+
cache: env.NODE_ENV !== 'development'
5353
},
5454

5555
supportEmail: 'iliakan@javascript.info',
5656

57-
projectRoot: process.cwd(),
57+
projectRoot: process.cwd(),
5858
// public files, served by nginx
59-
publicRoot: path.join(process.cwd(), 'public', lang),
59+
publicRoot: path.join(process.cwd(), 'public', lang),
6060
// private files, for expiring links, not directly accessible
61-
tutorialRoot: env.TUTORIAL_ROOT || path.join(process.cwd(), 'repo', `${env.TUTORIAL_LANG || lang}.javascript.info`),
62-
tmpRoot: path.join(process.cwd(), 'tmp', lang),
61+
tutorialRoot: env.TUTORIAL_ROOT || path.join(process.cwd(), 'repo', `${(env.TUTORIAL_LANG || lang).replace(/"/g, '')}.javascript.info`),
62+
tmpRoot: path.join(process.cwd(), 'tmp', lang),
6363
// js/css build versions
64-
cacheRoot: path.join(process.cwd(), 'cache', lang),
65-
assetsRoot: path.join(process.cwd(), 'assets'),
64+
cacheRoot: path.join(process.cwd(), 'cache', lang),
65+
assetsRoot: path.join(process.cwd(), 'assets'),
6666

6767
handlers: require('./handlers')
6868
};
@@ -71,13 +71,13 @@ let repo = `javascript-tutorial/${config.lang}.javascript.info`;
7171

7272
config.tutorialRepo = {
7373
github: repo,
74-
url: new URL('https://github.com/' + repo),
75-
tree: new URL('https://github.com/' + repo + '/tree/master'),
76-
blob: new URL('https://github.com/' + repo + '/blob/master')
74+
url: new URL('https://github.com/' + repo),
75+
tree: new URL('https://github.com/' + repo + '/tree/master'),
76+
blob: new URL('https://github.com/' + repo + '/blob/master')
7777
};
7878

7979

80-
require.extensions['.yml'] = function(module, filename) {
80+
require.extensions['.yml'] = function (module, filename) {
8181
module.exports = yaml.load(fs.readFileSync(filename, 'utf-8'));
8282
};
8383

@@ -95,7 +95,7 @@ createRoot(config.publicRoot);
9595
createRoot(config.cacheRoot);
9696
createRoot(config.tmpRoot);
9797

98-
function createRoot(root) {
98+
function createRoot (root) {
9999
// may be existing symlink
100100
if (fs.existsSync(root) && fs.statSync(root).isFile()) {
101101
fs.unlinkSync(root);

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "2.0.0",
44
"private": true,
55
"scripts": {
6+
"start":"cross-env PORT=8888 ./edit zh",
7+
"en":"cross-env PORT=8888 ./edit en",
68
"fixperms": "sudo chown -R `id -u` .* * ~/.n*",
79
"//": "test must exit with status 1 if fails, don't use | or ensure the right exit code if you do",
810
"test": "cross-env SELENIUM_LOCAL=1 NODE_ENV=test NODE_PATH=./modules ./node_modules/.bin/gulp test",

0 commit comments

Comments
 (0)