abra app cp doesn't understand - any more #200

Open
opened 2021-10-13 09:03:53 +00:00 by 3wordchant · 4 comments
Owner

Steps to reproduce

➜ tar -c * | abra app cp customhtml_sophielewis_lasophielle - app:/usr/share/nginx/html

Describe the expected behavior

  • All files in current directory copied to /usr/share/nginx/html

Describe the current behavior

FATA[0003] '-' does not exist?

Additional information

  • version: dev-8448949
## Steps to reproduce `➜ tar -c * | abra app cp customhtml_sophielewis_lasophielle - app:/usr/share/nginx/html` ## Describe the expected behavior - All files in current directory copied to `/usr/share/nginx/html` ## Describe the current behavior `FATA[0003] '-' does not exist?` ## Additional information <!-- run "abra version" on the command-line --> - version: dev-8448949
3wordchant added the
bug
abra
labels 2021-10-13 09:03:53 +00:00
Owner

Oh yeah I remember this...I think you can just pass the directory now? It does the tar'ing internally. I had no idea how to make the - input work at the time but could look into it again. Can you play around with the path argument and see if it works out 🙏

Oh yeah I remember this...I think you can just pass the directory now? It does the tar'ing internally. I had no idea how to make the `-` input work at the time but could look into it again. Can you play around with the path argument and see if it works out 🙏
3wordchant added the
enhancement
label 2021-10-13 23:07:34 +00:00
Author
Owner

Wow that's even better @decentral1se, another huge win for gobra :met

Leaving this gently open as an "enhancement" to track support for remaining long tail of madcap inter-server one-liners:

xclip -o -selection clipboard | abra app cp customhtml_sophielewis_lasophielle - app:/usr/share/nginx/html/index.html

(paste the HTML file in the clipboard to a remote server...)

Wow that's even better @decentral1se, another huge win for gobra :met Leaving this gently open as an "enhancement" to track support for remaining long tail of madcap inter-server one-liners: ``` xclip -o -selection clipboard | abra app cp customhtml_sophielewis_lasophielle - app:/usr/share/nginx/html/index.html ``` (paste the HTML file in the clipboard to a remote server...)
decentral1se removed the
bug
label 2021-10-14 10:34:09 +00:00

@3wordchant There is a way to make this work. urfave/cli won't mess with the solo - but we will need to check for it ourselves. Then when we find the - we can make the replacement of that arg to read stdin. Make this a custom handling for this command. Do you only do the contents of the files here when using bashbra or does it know when its a path? I think we need to do that parsing manually. I could get on it if you can describe how bashbra would react to that in different ways.

@3wordchant There is a way to make this work. urfave/cli won't mess with the solo `-` but we will need to check for it ourselves. Then when we find the `-` we can make the replacement of that arg to read stdin. Make this a custom handling for this command. Do you only do the contents of the files here when using bashbra or does it know when its a path? I think we need to do that parsing manually. I could get on it if you can describe how bashbra would react to that in different ways.
Author
Owner

@roxxers awesome 🤘

Do you only do the contents of the files here when using bashbra or does it know when its a path?

Not sure I understand this bit, could you expand any?

Do you only do the contents of the files here when using bashbra or does it know when its a path?

I think all the --handling comes from the underlying docker cp command, all bashbra does is translate service names to container IDs before throwing the args at it.

Some examples:

babra app foobar cp - app:/usr/share/nginx/html/index.html → copies the stream from STDIN to index.html
babra app foobar cp app:/usr/share/nginx/html/index.html - → streams index.html to STDOUT (although this is less critical cos it could be implemented with an abra app run foobar cat ...)

@roxxers awesome 🤘 > Do you only do the contents of the files here when using bashbra or does it know when its a path? Not sure I understand this bit, could you expand any? > Do you only do the contents of the files here when using bashbra or does it know when its a path? I think all the `-`-handling comes from the underlying `docker cp` command, all bashbra does is translate service names to container IDs before throwing the args at it. Some examples: `babra app foobar cp - app:/usr/share/nginx/html/index.html` → copies the stream from STDIN to `index.html` `babra app foobar cp app:/usr/share/nginx/html/index.html -` → streams `index.html` to STDOUT (although this is less critical cos it could be implemented with an `abra app run foobar cat ...`)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#200
No description provided.