Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Correctly set __dirname and __filename when running script file #185

Closed
metametadata opened this issue Jun 13, 2017 · 3 comments · Fixed by #402
Closed

Correctly set __dirname and __filename when running script file #185

metametadata opened this issue Jun 13, 2017 · 3 comments · Fixed by #402

Comments

@metametadata
Copy link

Steps:

  1. Create executable script in the subfolder:
~/dev/foo ᐅ tree
.
└── bar
    └── script.cljs

1 directory, 1 file

~/dev/foo ᐅ cat bar/script.cljs
#!/usr/bin/env lumo
(ns core.script)

(println js/__dirname)
(println js/__filename)
  1. Execute script from the outer folder:
~/dev/foo ᐅ ./bar/script.cljs

Actual output:

.
[eval]

Expected:

/Users/metametadata/dev/foo/bar
/Users/metametadata/dev/foo/bar/script.cljs
@metametadata
Copy link
Author

In v0.6.0 this stops working as soon as script requires some ns.

@anmonteiro
Copy link
Owner

So this is not fixed after all? Should we reopen?

@metametadata
Copy link
Author

metametadata commented Jul 4, 2017

@anmonteiro yes, let's reopen as it seems to work as expected only when there's no :require in script file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants