Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
427 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | module.exports = function (_require) {
|
---|
| 2 | _require = _require || require
|
---|
| 3 | var main = _require.main
|
---|
| 4 | if (main && isIISNode(main)) return handleIISNode(main)
|
---|
| 5 | else return main ? main.filename : process.cwd()
|
---|
| 6 | }
|
---|
| 7 |
|
---|
| 8 | function isIISNode (main) {
|
---|
| 9 | return /\\iisnode\\/.test(main.filename)
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | function handleIISNode (main) {
|
---|
| 13 | if (!main.children.length) {
|
---|
| 14 | return main.filename
|
---|
| 15 | } else {
|
---|
| 16 | return main.children[0].filename
|
---|
| 17 | }
|
---|
| 18 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.