Skip to content
This repository was archived by the owner on Jun 8, 2022. It is now read-only.

Commit ca1a39e

Browse files
Merge pull request #44 from lorengordon/fix-windows
Ensures quoted arguments are handled similarly across platforms
2 parents 4ca511f + fe16112 commit ca1a39e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

build.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Installs dependencies with pip automatically.
33

44
import os
5+
import shlex
56
import shutil
67
import subprocess
78
import sys
@@ -104,9 +105,17 @@ def create_zip_file(source_dir, target_file):
104105
)
105106

106107

107-
filename = sys.argv[1]
108-
runtime = sys.argv[2]
109-
source_path = sys.argv[3]
108+
def dequote(value):
109+
"""
110+
Handles quotes around values in a shell-compatible fashion.
111+
112+
"""
113+
return ' '.join(shlex.split(value))
114+
115+
116+
filename = dequote(sys.argv[1])
117+
runtime = dequote(sys.argv[2])
118+
source_path = dequote(sys.argv[3])
110119

111120
absolute_filename = os.path.abspath(filename)
112121

0 commit comments

Comments
 (0)