mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -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:
parent
f917c5e722
commit
7c5db007de
2 changed files with 9 additions and 2 deletions
|
@ -22,4 +22,4 @@ run([
|
||||||
# Do not format these.
|
# Do not format these.
|
||||||
# js/msg_generated.ts
|
# js/msg_generated.ts
|
||||||
# js/flatbuffers.js
|
# js/flatbuffers.js
|
||||||
run(["rustfmt", "--write-mode", "overwrite"] + glob("src/*.rs"))
|
run(["rustfmt", "-f", "--write-mode", "overwrite"] + glob("src/*.rs"))
|
||||||
|
|
|
@ -7,12 +7,19 @@ import subprocess
|
||||||
def run(args):
|
def run(args):
|
||||||
print " ".join(args)
|
print " ".join(args)
|
||||||
env = os.environ.copy()
|
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)
|
subprocess.check_call(args, env=env)
|
||||||
|
|
||||||
|
|
||||||
def remove_and_symlink(target, name, target_is_dir=False):
|
def remove_and_symlink(target, name, target_is_dir=False):
|
||||||
try:
|
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:
|
except:
|
||||||
pass
|
pass
|
||||||
symlink(target, name, target_is_dir)
|
symlink(target, name, target_is_dir)
|
||||||
|
|
Loading…
Add table
Reference in a new issue