Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
unalignedcoder opened this issue Feb 27, 2023 · 0 comments

Comments

@unalignedcoder
Copy link

unalignedcoder commented Feb 27, 2023

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/[email protected] (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/'[email protected] (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/\'[email protected] (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/'[email protected] (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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant