devmatteini / dra

A command line tool to download release assets from GitHub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Access Denied using `--output`

ZanzyTHEbar opened this issue · comments

Hello, me again. I've gotten dra properly integrated into my app now and only have one more issue with it.

I can't seem to use the --output arg. My app can read and write to the directory i am targeting, but dra can't. I've tried in terminal, and via my apps shell process caller. Neither work unless i am in an elevated terminal. Is this by design?

It's unfortunate as i would really like to use this feature to download the file(s) to the proper directory. Elevating the shell process in my app is not really an option - and is bad security practice. I'd really just like to be able to pass in a directory and have dra write to it.

Figured out my error :)

I have to append the file name to the URL to output to.

Would be nice if dra could append the file name from the server or url to the file path that was put in.

I can't seem to use the --output arg. My app can read and write to the directory i am targeting, but dra can't. I've tried in terminal, and via my apps shell process caller. Neither work unless i am in an elevated terminal. Is this by design?

No, dra does nothing fancy. It uses the user privileges. You probably don't have permissions to write to that directory.

Would be nice if dra could append the file name from the server or url to the file path that was put in.

As described by dra download --help:

  -o, --output <OUTPUT>
          Save asset to custom path

          Default path is current working directory and the name of the asset.

          If used with `--install` it must be a directory path

If you pass just a directory to -o like dra download -o /tmp devmatteini/dra-tests you would get a pretty explanatory error (on linux in my case):

Failed to create the file /tmp: Is a directory (os error 21)

Maybe this could be improved by automatically adding the asset name if only a directory path is given.