Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 5f01cc3

Browse files
fixed some env var issues
1 parent 4c9233b commit 5f01cc3

File tree

6 files changed

+30
-14
lines changed

6 files changed

+30
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Getting up and running is as easy as 1, 2, 3, 4 ... 5.
7272
> ##### IMPORTANT for WIN users:
7373
> - make sure you have mongo bin directory added to your PATH
7474
> - if you picked another data directory during mongodb setup make sure
75-
> to change package.json scripts section for key "dev-win" so it points to
75+
> to change package.json scripts section for key "dev:win" so it points to
7676
> the proper path. Otherwise you will get missing data path errors from mongodb.
7777
7878
If you did it right it will seed some fake data for you and downloads some images and avatar for faster development.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@
3434
},
3535
"scripts": {
3636
"clear": "rm -Rf tmp",
37-
"test": "npm run eslint && cross-env NODE_ENV=test nyc --reporter=text-summary npm run mocha",
38-
"test:mongo": "npm run eslint && cross-env NODE_ENV=test nyc --reporter=text-summary npm run mocha:mongo",
39-
"test:coverage": "npm run eslint && cross-env NODE_ENV=test nyc --reporter=lcovonly --reporter=text-summary npm run mocha",
37+
"test": "$npm_package_config_nyc npm run mocha",
38+
"test:mongo": "$npm_package_config_nyc npm run mocha:mongo",
39+
"test:coverage": "$npm_package_config_nyc --reporter=lcovonly npm run mocha",
4040
"eslint": "eslint server/. test/. --config .eslintrc.json",
4141
"start": "concurrently 'mongod' 'wait-on tcp:27017 && cross-env NODE_ENV=production node server/'",
42-
"start:win": "concurrently \"mongod\" \"wait-on tcp:27017 &&SET NODE_ENV=production&& node server/\"",
4342
"dev:debug": "npm run clear && concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && cross-env DEBUG=feathers && cross-env NODE_ENV=development nodemon --inspect server/'",
4443
"dev": "npm run clear && concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && cross-env DEBUG=feathers && cross-env NODE_ENV=development nodemon server/'",
4544
"dev:local": "sh scripts/run-local.sh",
@@ -49,6 +48,7 @@
4948
"mocha:mongo": "$npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && npm run mocha'"
5049
},
5150
"config": {
51+
"test": "npm run eslint && cross-env NODE_ENV=test nyc --reporter=text-summary",
5252
"mongoDev": "mongod --dbpath data --quiet",
5353
"mocha": "cross-env NODE_ENV=test node_modules/mocha/bin/_mocha test/ --recursive --timeout 10000 --exit",
5454
"concurrently": "concurrently --kill-others --success first"
@@ -108,7 +108,7 @@
108108
"devDependencies": {
109109
"babel-eslint": "~8.2.3",
110110
"concurrently": "~3.5.1",
111-
"cross-env": "^5.1.5",
111+
"cross-env": "^5.2.0",
112112
"eslint": "~4.19.1",
113113
"istanbul": "1.1.0-alpha.1",
114114
"mocha": "~5.2.0",

server/mongoose.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function () {
1212
connectTimeoutMS: 10000,
1313
socketTimeoutMS: 10000
1414
}, function () {
15-
if (process.NODE_ENV !== 'production' && app.get('seeder').dropDatabase === true) {
15+
if (process.env.NODE_ENV !== 'production' && app.get('seeder').dropDatabase === true) {
1616
mongoose.connection.dropDatabase().then(() => {
1717
app.debug('>>>>>> DROPED DATABASE <<<<<<');
1818
let uploadDir = path.resolve('public/uploads');

server/seeder/development/users-admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = (seederstore) => {
1616
coverImg: 'https://source.unsplash.com/random/1250x280',
1717
badgeIds: () => {
1818
let badges = [keys(seederstore.badges)[0]];
19-
if (process.NODE_ENV !== 'production') {
19+
if (process.env.NODE_ENV !== 'production') {
2020
badges.push(keys(seederstore.badges)[5]);
2121
badges.push(keys(seederstore.badges)[10]);
2222
badges.push(keys(seederstore.badges)[16]);

server/services/auth-management/notifier.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ module.exports = function (app) {
124124
app.debug('Sent email', result);
125125
})
126126
.catch(err => {
127-
app.error('Error sending email', err);
127+
if (process.env.NODE_ENV !== 'test') {
128+
app.error('Error sending email', err);
129+
}
128130
});
129131
}
130132

yarn.lock

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,11 +1082,11 @@ create-error-class@^3.0.0:
10821082
dependencies:
10831083
capture-stack-trace "^1.0.0"
10841084

1085-
cross-env@^5.1.5:
1086-
version "5.1.5"
1087-
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.1.5.tgz#31daf7f3a52ef337c8ddda585f08175cce5d1fa5"
1085+
cross-env@^5.2.0:
1086+
version "5.2.0"
1087+
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
10881088
dependencies:
1089-
cross-spawn "^5.1.0"
1089+
cross-spawn "^6.0.5"
10901090
is-windows "^1.0.0"
10911091

10921092
cross-spawn@^3.0.0:
@@ -1104,6 +1104,16 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
11041104
shebang-command "^1.2.0"
11051105
which "^1.2.9"
11061106

1107+
cross-spawn@^6.0.5:
1108+
version "6.0.5"
1109+
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
1110+
dependencies:
1111+
nice-try "^1.0.4"
1112+
path-key "^2.0.1"
1113+
semver "^5.5.0"
1114+
shebang-command "^1.2.0"
1115+
which "^1.2.9"
1116+
11071117
crypt@~0.0.1:
11081118
version "0.0.2"
11091119
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
@@ -3621,6 +3631,10 @@ [email protected]:
36213631
version "0.6.1"
36223632
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
36233633

3634+
nice-try@^1.0.4:
3635+
version "1.0.4"
3636+
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"
3637+
36243638
36253639
version "2.0.0"
36263640
resolved "https://registry.yarnpkg.com/nocache/-/nocache-2.0.0.tgz#202b48021a0c4cbde2df80de15a17443c8b43980"
@@ -3963,7 +3977,7 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2:
39633977
version "1.0.2"
39643978
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
39653979

3966-
path-key@^2.0.0:
3980+
path-key@^2.0.0, path-key@^2.0.1:
39673981
version "2.0.1"
39683982
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
39693983

0 commit comments

Comments
 (0)