gdrive-downloader icon indicating copy to clipboard operation
gdrive-downloader copied to clipboard

chmod flags not compatible with mac?

Open klokie opened this issue 1 year ago • 4 comments

Hi, I'm trying to get this working on a Mac M1 running Mac OS Ventura (13.3.1). I've got Homebrew and used it to install both this script and bash 5.2.15.

The script exits after the "Enter Client ID" step, with the error "chmod: --: No such file or directory". I wasn't familiar with the double dash -- syntax, maybe it's not supported by the chmod provided by MacOS?

klokie avatar May 15 '23 21:05 klokie

Yup, same for FreeBSD. The script does this in case the filename starts with a - to prevent chmod interpreting as an option. A portable way to do this would be to prefix filenames that start with a - with ./.

I don't know why the script is chmod'ing files in the first place. It should just set a umask or fall back to the umask it inherits from the environment.

jaysoffian avatar Jun 01 '23 00:06 jaysoffian

A portable way to do this would be to prefix filenames that start with a - with ./.

I tried that, but the script still exited. The only way I could get it to run was by removing all calls to chmod; then it worked ok.

klokie avatar Jun 01 '23 07:06 klokie

Hmm, i will try to fix.

Akianonymus avatar Jun 02 '23 05:06 Akianonymus

A portable way to do this would be to prefix filenames that start with a - with ./.

I tried that, but the script still exited. The only way I could get it to run was by removing all calls to chmod; then it worked ok.

I didn't mean for you to prefix filenames. I meant that the script would need to be updated to remove -- and use ./$filename instead in cases where $filename does not start with /. The reason the -- was put into the script was in case a filename starts with a - to prevent chmod from interpreting it as an option.

jaysoffian avatar Jun 03 '23 20:06 jaysoffian