Skip to content

Commit df306c7

Browse files
committed
Quote directory names when installing the runtime to allow spaces in the directory names.
1 parent ba96617 commit df306c7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/PythonBridge-Pharo/PBPharoPlatform.class.st

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PBPharoPlatform class >> weakRegistryClass [
3737
{ #category : #private }
3838
PBPharoPlatform >> copyApplicationTo: appFolder application: application [
3939
"Copy the PythonBridge runtime environment to the specified folder"
40-
| srcDir cpCommand proc pbSymLink |
40+
| srcDir cpCommand proc pbSymLink srcFilename dstFilename |
4141

4242
srcDir := FileLocator imageDirectory / 'PythonBridge'.
4343
(srcDir exists and: [ srcDir ~= appFolder ]) ifFalse:
@@ -46,12 +46,15 @@ PBPharoPlatform >> copyApplicationTo: appFolder application: application [
4646
[ self error: 'Unable to locate PythonBridge runtime files' ].
4747

4848
"Copy the runtime directory"
49+
srcFilename := srcDir fullName copyReplaceAll: '"' with: '\"'.
50+
dstFilename := appFolder fullName copyReplaceAll: '"' with: '\"'.
4951
cpCommand := String streamContents: [ :stream |
5052
stream
51-
<< 'cp -a ';
52-
<< srcDir fullName;
53-
<< ' ';
54-
<< appFolder fullName ].
53+
<< 'cp -a "';
54+
<< srcFilename;
55+
<< '" "';
56+
<< dstFilename;
57+
<< '"' ].
5558
proc := OSSUnixSubprocess new
5659
shellCommand: cpCommand;
5760
runAndWait.

0 commit comments

Comments
 (0)