mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 03:44:05 -05:00
tools: remove_and_symlink can be skipped on unix
This is more optimial and this fixes a problem where occasionally remove_and_symlink will error with: gen/compiler_bundle/main.js --sourcemapFile /Users/rld/src/deno --silent Traceback (most recent call last): File "../../tools/run_node.py", line 18, in <module> util.remove_and_symlink(target_rel, "node_modules", True) File "/Users/rld/src/deno/tools/util.py", line 103, in remove_and_symlink symlink(target, name, target_is_dir) File "/Users/rld/src/deno/tools/util.py", line 141, in symlink os.symlink(target, name) OSError: [Errno 17] File exists
This commit is contained in:
parent
8d3e8b1c64
commit
bba1a0d44a
1 changed files with 2 additions and 0 deletions
|
@ -92,6 +92,8 @@ def green_ok():
|
|||
|
||||
|
||||
def remove_and_symlink(target, name, target_is_dir=False):
|
||||
if os.name != "nt" and os.path.islink(name):
|
||||
return
|
||||
try:
|
||||
# On Windows, directory symlink can only be removed with rmdir().
|
||||
if os.name == "nt" and os.path.isdir(name):
|
||||
|
|
Loading…
Add table
Reference in a new issue