mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
* Better form submit format
* Allow comments in menu.json
This commit is contained in:
parent
d1b0663b5d
commit
4c4b0de54c
7 changed files with 118 additions and 80 deletions
|
@ -1,6 +1,7 @@
|
|||
"use strict";
|
||||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
var paths = require('path');
|
||||
var paths = require('path');
|
||||
|
||||
exports.isProduction = isProduction;
|
||||
exports.isDevelopment = isDevelopment;
|
||||
|
@ -10,19 +11,19 @@ exports.resolvePath = resolvePath;
|
|||
function isProduction() {
|
||||
var env = process.env.NODE_ENV || 'dev';
|
||||
return 'production' === env;
|
||||
};
|
||||
}
|
||||
|
||||
function isDevelopment() {
|
||||
return (!(isProduction()));
|
||||
};
|
||||
}
|
||||
|
||||
function valueWithDefault(val, defVal) {
|
||||
return (typeof val !== 'undefined' ? val : defVal);
|
||||
};
|
||||
}
|
||||
|
||||
function resolvePath(path) {
|
||||
if(path.substr(0, 2) === '~/') {
|
||||
path = (process.env.HOME || process.env.HOMEPATH || process.env.HOMEDIR || process.cwd()) + path.substr(1);
|
||||
}
|
||||
return paths.resolve(path);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue