1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

tools: fix windows

This fixes most things, but format.py doesn't work yet, because
yapf is broken due to some depot_tools shimming python.
This commit is contained in:
Bert Belder 2018-07-08 19:14:55 +02:00 committed by Ryan Dahl
parent f917c5e722
commit 7c5db007de
2 changed files with 9 additions and 2 deletions

View file

@ -22,4 +22,4 @@ run([
# Do not format these.
# js/msg_generated.ts
# js/flatbuffers.js
run(["rustfmt", "--write-mode", "overwrite"] + glob("src/*.rs"))
run(["rustfmt", "-f", "--write-mode", "overwrite"] + glob("src/*.rs"))

View file

@ -7,12 +7,19 @@ import subprocess
def run(args):
print " ".join(args)
env = os.environ.copy()
if os.name == "nt":
# Run through shell to make .bat/.cmd files work.
args = ["cmd", "/c"] + args
subprocess.check_call(args, env=env)
def remove_and_symlink(target, name, target_is_dir=False):
try:
os.unlink(name)
# 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:
pass
symlink(target, name, target_is_dir)