tomkyle / tuplo
Configurabe upload script for use with CLI and/or Typora
Requires
- php: ^8.1
- league/flysystem: ^3.0
- league/flysystem-ftp: ^3.0
- league/flysystem-memory: ^3.0
- league/flysystem-path-prefixing: ^3.3
- league/flysystem-sftp-v3: ^3.0
- mnapoli/silly: ^1.8
- mnapoli/silly-php-di: ^1.2
- php-di/php-di: ^6.0
- symfony/yaml: ^6.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0|^3.0
- php-coveralls/php-coveralls: ^2.0
- phpspec/prophecy: ^1.15
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-12-12 09:38:08 UTC
README
tuplo is a CLI upload tool. It can be configured with YAML files. Currently, these upload methods are supported:
- FTP
- SFTP with username/password
- SFTP with SSH key
Installation
Using Composer
Install tuplo as global command:
$ composer global require tomkyle/tuplo
Do not forget to make sure Composer’s global commands are available in $PATH
:
# Unix, Linux, et al. export PATH="/home/username/.config/composer/vendor/bin:${PATH}" # MacOS export PATH="/Users/you/.composer/vendor/bin:${PATH}"
Linux, Unix et.al.
Grab repo content and install dependencies. You may want to symlink it in your ~/bin
directory:
$ git clone git@github.com:tomkyle/tuplo.git $ cd tuplo # Symlink if needed $ ln -s "${PWD}/bin/tuplo" ~/bin/tuplo
MacOS
To be done, I'm working on it.
Configuration
Upload configurations can be stored in a .tuplo.yaml
file, either in $HOME
directory or in current work directory; with the latter preceding the first. See tuplo.dist.yaml for examples – here an example for a plain old FTP upload. In this example, “typora” is the name of a single upload configuration, it is used as CLI parameter.
typora: description : Just a plain FTP example method : ftp downloadUrl : "https://test.com/typora" host : 'ftp.test.com' port : 21 ssl : false root : 'path/to/typora' username : 'ftp-username' password : 'ftp-password'
Usage
According to the above configuration sample, CLI usage goes like this.
$ tuplo typora <file> [file] ...
Development and testing
This repo contains custom Git hooks to automate composer installs after composer.lock has changed after git pull. Read more here.
Bugs and issues
Any hints are welcome and appreciated! Open a ticket on GitHub’s issue tracker.
Unit tests
Default configuration is phpunit.xml.dist. If you like, create a custom phpunit.xml to apply your own settings. Also visit phpunit.readthedocs.io · Packagist
$ composer phpunit
# ... or
$ vendor/bin/phpunit
PhpStan
Default configuration is phpstan.neon.dist. If you like, create a custom phpstan.neon to apply your own settings. Also visit phpstan.org · GitHub · Packagist
$ composer phpstan
# ... which includes
$ vendor/bin/phpstan analyse
PhpCS
Default configuration is .php-cs-fixer.dist.php. If you like, create a custom .php-cs-fixer.php to apply your own settings. Also visit cs.symfony.com · GitHub · Packagist
$ composer phpcs
# ... which aliases
$ vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
Apply all CS fixes:
$ composer phpcs:apply
# ... which aliases
$ vendor/bin/php-cs-fixer fix --verbose --diff