mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
tools/run_node: only create 'node_modules' symlink once
Previously run_node.py would always attempt to remove and then re-create the 'target/xx/node_modules' symlink. This causes sporadic build errors on windows when multiple build targets that use run_node.py are being built concurrently.
This commit is contained in:
parent
860be9f0de
commit
ee29ed79a7
2 changed files with 6 additions and 22 deletions
|
@ -93,20 +93,6 @@ def green_ok():
|
|||
return "%sok%s" % (FG_GREEN, RESET)
|
||||
|
||||
|
||||
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):
|
||||
os.rmdir(name)
|
||||
else:
|
||||
os.unlink(name)
|
||||
except OSError:
|
||||
pass
|
||||
symlink(target, name, target_is_dir)
|
||||
|
||||
|
||||
def symlink(target, name, target_is_dir=False):
|
||||
if os.name == "nt":
|
||||
from ctypes import WinDLL, WinError, GetLastError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue