-
-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: search path resolution for cli (#3694)
the current behavior is that the current directory does *not* get into the search path when `-p` is specified, which is annoying. (one would expect `vyper some/directory/some/file.vy` to compile no matter what `-p` is specified as). this commit also handles the addition of multiple search paths specified on the CLI, and adds a long `--path` option as an alternative to `-p`.
- Loading branch information
1 parent
0cbc94d
commit b0ea5b6
Showing
4 changed files
with
49 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import contextlib | ||
import os | ||
|
||
|
||
@contextlib.contextmanager | ||
def working_directory(directory): | ||
tmp = os.getcwd() | ||
try: | ||
os.chdir(directory) | ||
yield | ||
finally: | ||
os.chdir(tmp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters