Skip to content

Working directory doesn't seem to work if there are spaces in the name #85

@unalignedcoder

Description

@unalignedcoder

Problem description

When there are spaces in the working directory, the action fails silently.
When the same command is ran in Termux, everything works fine.

Steps to reproduce

  • Install zip package
  • From a MacroDroid macro, call the Termux plugin
  • Point to the zip executable in the bin directory:
    /data/data/com.termux/files/usr/bin/zip
  • add the following arguments:
    -u Archive.zip *.txt or
    -c Archive.zip *.txt
  • In the Working directory path, add a path with spaces, such as:
    /storage/emulated/0/Android/media/com.seafile.seadroid2/Seafile/user@domain.com (domain.com)/archives

As such, the script fails silently.
No stdout not stderr

If I add quotes around the space name, such as this:
/storage/emulated/0/Android/media/com.seafile.seadroid2/Seafile/'user@domain.com (domain.com)'/archives
Termux-tasker warns "The working directory not found at path".
Same if I include escape characters, such as:
/storage/emulated/0/Android/media/com.seafile.seadroid2/Seafile/\'user@domain.com (domain.com)\'/archives

If I ignore the warning and save the action, the action fails with this stdout:
zip warning Archive.zip not found or empty
zip warning: name not matched: *.txt

However, the files are there. In fact, if I try this in Termux, by doing:
cd /storage/emulated/0/Android/media/com.seafile.seadroid2/Seafile/'user@domain.com (domain.com)'/archives
(notice the quotes around the part of the name with spaces) and then:
zip -u Archive.zip *.txt

everything works correctly. The zip file is updated.

As far as I can tell, permissions are correctly set.

Expected Behavior
Unless this is caused by a different issue altogether, I expect Termux-tasker to handle spaces in names on its own, or to understand the standard use of single quotes around the parts with spaces.

Additional information

  • Termux application version: 0.118.0
  • Android OS version: 10
  • Device model: Ulefone 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions