Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Commit a5896f2

Browse files
John McCormackJohn McCormack
John McCormack
authored and
John McCormack
committed
automate setting the ROOT variable
1 parent 1ba0ccb commit a5896f2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

utils.coffee

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ TAG = 'mailer-utils'
2020
if process.env.BUNDLE_PATH
2121
ROOT = path.join(process.env.BUNDLE_PATH, 'programs', 'server', 'assets', 'app')
2222
else if process.env.APP_DIR
23-
ROOT = path.join(process.env.APP_DIR, 'programs','server', 'assets', 'app')
24-
else
25-
23+
ROOT = path.join(process.env.APP_DIR, 'programs','server', 'assets', 'app')
24+
else if process.env.NODE_ENV == 'development'
2625
# In development, using pwd is fine. Remove the .meteor/foo/bar stuff though.
2726
realPath = process.cwd().replace(/(\.meteor.*)/g, '')
2827
ROOT = path.join(realPath, 'private')
28+
else
29+
meteor_root = fs.realpathSync( process.cwd() + '/../' )
30+
application_root = fs.realpathSync( meteor_root + '/../' )
31+
ROOT = path.join(application_root, 'programs', 'server', 'assets', 'app')
2932

3033
Utils =
3134

0 commit comments

Comments
 (0)