Skip to content

Commit

Permalink
respect scripts path inside bin/Scripts dir
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgaz12 committed Jul 14, 2023
1 parent 1b8c33b commit ff5ff1f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions conda_build/noarch_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import locale
import logging
import os
import re
import shutil
import sys
from os.path import basename, dirname, isdir, isfile, join
Expand Down Expand Up @@ -44,9 +45,8 @@ def rewrite_script(fn, prefix):
fn = fn[:-10]

# Rewrite the file to the python-scripts directory
dst_dir = join(prefix, "python-scripts")
_force_dir(dst_dir)
dst = join(dst_dir, fn)
dst = join(prefix, "python-scripts", fn)
_force_dir(dirname(dst))
with open(dst, "w") as fo:
fo.write(data)
os.chmod(dst, src_mode)
Expand Down Expand Up @@ -80,7 +80,8 @@ def handle_file(f, d, prefix):

# Treat scripts specially with the logic from above
elif f.startswith(("bin/", "Scripts")):
fn = basename(path)
*_, fn = re.split("(bin|Scripts)", path)
fn = fn.split(os.sep, 1)[1]
fn = rewrite_script(fn, prefix)
d["python-scripts"].append(fn)

Expand Down

0 comments on commit ff5ff1f

Please sign in to comment.