PapirusDevelopmentTeam / papirus-folders

a script that lets you change the colors of folders in Papirus icon theme
https://git.io/papirus-folders
MIT License
600 stars 32 forks source link

Cannot change folders' colour #7

Closed ghost closed 5 years ago

ghost commented 5 years ago

The tool is broken after the commit 8d75a871ae8bc3794844037402d03bb8451caae8.

Now, every time I try to change folders' colour, the following error message is thrown: /usr/bin/papirus-folders: line 258: mapfile: -d: invalid option mapfile: usage: mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]

SmartFinn commented 5 years ago

Show me the output of the following commands:

cat /etc/os-release
bash --version
SmartFinn commented 5 years ago

I found one way to make the script compatibility with older bash versions, but it's ugly. I should know what distro you use to test it.

ghost commented 5 years ago

Hi @SmartFinn,

I should have left the info for you to debug. Sorry about that. Here it is:

NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)

Thanks a lot.

SmartFinn commented 5 years ago

There is a problem. The workaround always returns error code 1:

$ > IFS=$'\n' read -d "" -ra array < <(find . -type f  -print)
$ > echo $?
1

I fail to solve issue #6 without mapfile -d that appeared in bash 4.4-alpha.

A solution that I thought up is the following:

  1. Revert that commit
  2. Create the release with bash <4.4 support
  3. Build a deb package from this release
  4. Discontinue support for bash ≥4.4 and disable daily builds for xenial

You can use a temporary workaround for now:

wget -qO- https://raw.githubusercontent.com/PapirusDevelopmentTeam/papirus-folders/master/install.sh | env TAG=v0.0.8 sh
SmartFinn commented 5 years ago

I fixed it by replaced find command to for-loop statement. Now, no needs to use mapfile -d or while read.