Skip to content

dojo fails on macosx when certain symbols appear in current path #37

Closed
@maxamg

Description

@maxamg

When the current execution directory contains certain symbols like a space, or brace, dojo fails to run.

3 tests with different paths:

$ find /tmp/test*
/tmp/test 2
/tmp/test 2/Dojofile
/tmp/test(3)
/tmp/test(3)/Dojofile
/tmp/test1
/tmp/test1/Dojofile

Tests run below to reproduce:

### Test 1
$ cd /tmp/test1
$ dojo ##works

### Test 2
$ cd /tmp/test\ 2
$ dojo ## fails with below
2023/09/08 17:44:44 [ 1]  INFO: (main.main) Dojo version 0.11.0
2023/09/08 17:44:44 [ 7]  INFO: (main.DockerDriver.HandleRun) docker command will be:
 docker run --rm -v /tmp/test 2:/dojo/work -v /Users/maxgriff:/dojo/identity:ro -v /tmp/dojo-environment-multiline-dojo-test 2-2023-09-08_17-44-44-99075616:/etc/dojo.d/variables/00-multiline-vars.sh -v /tmp/dojo-environment-bash-functions-dojo-test 2-2023-09-08_17-44-44-99075616:/etc/dojo.d/variables/01-bash-functions.sh --env-file=/tmp/dojo-environment-dojo-test 2-2023-09-08_17-44-44-99075616 -ti --name=dojo-test 2-2023-09-08_17-44-44-99075616 joii/infra-joi-dojo:0.9.0
docker: invalid reference format.
See 'docker run --help'.

### Test 3
$ cd test\(3\)
$ dojo ## fails with below
2023/09/08 17:45:50 [ 1]  INFO: (main.main) Dojo version 0.11.0
2023/09/08 17:45:50 [ 5]  INFO: (main.DockerDriver.HandleRun) docker command will be:
 docker run --rm -v /tmp/test(3):/dojo/work -v /Users/maxgriff:/dojo/identity:ro -v /tmp/dojo-environment-multiline-dojo-test(3)-2023-09-08_17-45-50-64469552:/etc/dojo.d/variables/00-multiline-vars.sh -v /tmp/dojo-environment-bash-functions-dojo-test(3)-2023-09-08_17-45-50-64469552:/etc/dojo.d/variables/01-bash-functions.sh --env-file=/tmp/dojo-environment-dojo-test(3)-2023-09-08_17-45-50-64469552 -ti --name=dojo-test(3)-2023-09-08_17-45-50-64469552 joii/infra-joi-dojo:0.9.0
bash: -c: line 1: syntax error near unexpected token `('
bash: -c: line 1: `docker run --rm -v /tmp/test(3):/dojo/work -v /Users/maxgriff:/dojo/identity:ro -v /tmp/dojo-environment-multiline-dojo-test(3)-2023-09-08_17-45-50-64469552:/etc/dojo.d/variables/00-multiline-vars.sh -v /tmp/dojo-environment-bash-functions-dojo-test(3)-2023-09-08_17-45-50-64469552:/etc/dojo.d/variables/01-bash-functions.sh --env-file=/tmp/dojo-environment-dojo-test(3)-2023-09-08_17-45-50-64469552 -ti --name=dojo-test(3)-2023-09-08_17-45-50-64469552 joii/infra-joi-dojo:0.9.0'

Running in 'safe' directory but referencing Dojofile using -c param works fine
e.g.

$ cd $HOM£
$ dojo -c /tmp/test\(3\)/Dojofile ## works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions