Giter Site home page Giter Site logo

Comments (9)

tavinus avatar tavinus commented on August 16, 2024

Hi.

I have pushed a new release (v0.1.7) with the -r / --rename option to do that.

EDIT: Ok, I have changed a lot of things that I wanted and also made the option/parameters parsing more robust. I have released it as v2.0.0.


Cloudsend v2 changed the way password parsing works.
Cloudsend 0.x.x used the -p parameter for the Environment password (changed to -e in v2+).
Please use EITHER -e OR -p, but not both. The last to be called will be used.

  • Env Pass > Set the variable CLOUDSEND_PASSWORD='MySecretPass' and use the option -e
  • Param Pass > Send the password as a parameter with -p <password>

I still need testers, so...
Can you please test it and report back?

from cloudsend.sh.

nthiery avatar nthiery commented on August 16, 2024

from cloudsend.sh.

nthiery avatar nthiery commented on August 16, 2024

Note: I tested with an anonymous file drop; so that did not exercise the password passing options.

from cloudsend.sh.

nthiery avatar nthiery commented on August 16, 2024

Now that the -r option is there, this made me wonder whether one could pipe in the input file?
Something like:

echo coucou | cloudsend -r <filename> <url>

Typical use case: creating a remote archive on the fly:

tar -c foo/ | cloudsend.sh -r foo.tar <url>

I can create a separate issue if you prefer.

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

I don't think you can pipe it like that.

The way this script is implemented, we need a file to send to curl as the origin and then we can use the same name or another one at the destination.

For now, you will need to save the file, send it, and then delete it (in your script).

So we would need to find a way to pipe the content of the file as the origin to curl. I think this is possible, but would change a lot the curl call.

So, we would probably need a different call for this use case, which may be ok. The first step is to have an example curl call with the content being piped like that.

There is usually a flag to trigger pipe input. Most times a single dash at the end is used ( - ).

I am not sure I will have the time to try this soon. Would be easier if you can come up with a curl example.


EDIT: Curl is used with -T <file> and the manual says
image

I will try to see if this is already working when using - and/or . as input file. I will need to add a check for the destination name as well though, and maybe even rename the option.

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

Hi. I have released a new version (2.1.0) which can both send multiple files (using globs) and also send piped content (using - OR . as input file name).


Here are the release notes:

  • Adds stdin as input option (piped content)
    • uses either - or . as input file name
    • requires -r <filename>
  • Allows to use globbing at the input
    • can send multiple files by using globs
    • requires -g option
    • not compatible with -r <name> option (rename)
  • Adds new checks and parsing
  • Cleaned up unused code
  • Updated readme and --help

There is more info on the main Readme file.

from cloudsend.sh.

nthiery avatar nthiery commented on August 16, 2024

Cool! I just tried:

echo coucou | /opt/cloudsend.sh/cloudsend.sh . -r truc.md <url>

The file truc.md is indeed created, but empty. Am I doing something wrong?

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

That is weird, I just tried echoing without problems.
Both - and . worked fined.
Both quoted and unquoted strings, need quotes if sending multiple lines/spaces/etc.
But echo Test also worked just fine.

With .

echo $'testing\nSuper Test\nTestAgain' | ./cloudsend.sh . https://cloud.mydomain.net/s/TxWnFJ7Ln3X5yHs -r testPipe4.txt -p MyPass123

With -

echo $'testing\nSuper Test\nTestAgain' | ./cloudsend.sh - https://cloud.mydomain.net/s/TxWnFJ7Ln3X5yHs -r testPipe5.txt -p MyPass123

And the files
image
image

EDIT I was wondering if having the -r <name> between . AND URL was a problem, but I just tested it and it also went fine.

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

After more than 2 months I will guess this is solved.
Feel free to post again or reopen if the problem persists.

from cloudsend.sh.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.