Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,12 @@ def pip_requirements_step(path, prefix=None, required=False):
hash(requirements)

def commands_step(path, commands):
if not commands:
return

if isinstance(commands, str):
commands = map(str.strip, commands.splitlines())

if path:
path = os.path.normpath(path)
batch = []
Expand Down Expand Up @@ -737,15 +743,16 @@ def execute(self, build_plan, zip_stream, query):
source_path, prefix = action[1:]
if sh_work_dir:
if source_path != sh_work_dir:
source_path = sh_work_dir
if not os.path.isfile(source_path):
source_path = sh_work_dir
if os.path.isdir(source_path):
if pf:
self._zip_write_with_filter(zs, pf, source_path, prefix,
timestamp=ts)
else:
if os.path.isdir(source_path):
zs.write_dirs(source_path, prefix=prefix, timestamp=ts)
else:
zs.write_file(source_path, prefix=prefix, timestamp=ts)
zs.write_dirs(source_path, prefix=prefix, timestamp=ts)
else:
zs.write_file(source_path, prefix=prefix, timestamp=ts)
elif cmd == 'pip':
runtime, pip_requirements, prefix = action[1:]
with install_pip_requirements(query, pip_requirements) as rd:
Expand Down