https://github.com/xiaoxiaojx/publish-sftp
One-line command to quickly publish resources to a specified server
https://github.com/xiaoxiaojx/publish-sftp
ftp ftp-client sftp sftp-client
Last synced: 5 months ago
JSON representation
One-line command to quickly publish resources to a specified server
- Host: GitHub
- URL: https://github.com/xiaoxiaojx/publish-sftp
- Owner: xiaoxiaojx
- Created: 2018-10-18T12:56:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-02T17:20:01.000Z (about 4 years ago)
- Last Synced: 2024-04-14T06:13:31.149Z (over 1 year ago)
- Topics: ftp, ftp-client, sftp, sftp-client
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 44
- Watchers: 1
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
One-line command to quickly publish resources to a specified server..
### Usage
> Add sftp.json to the root of the project
```
// ./sftp.json
{
"localPath": "./dist",
"remotePath": "/export/App/xxx",
"protectedRemotePath": "/export/App/xxx",
"connect": {
"host": "xxx.xxx.xxx.xx",
"port": 22,
"username": "root",
"password": "123456"
}
}
```### Getting started
```
yarn add publish-sftp
```

> 复制 localPath 下所有文件到 remotePath/xjx/test, -c 参数为空则是复制到 remotePath, 远程目录不存在会先创建#### copy
> 复制 localPath 下所有文件到 remotePath 目录下, 如果 xxx 有值则是复制到 `${remotePath}/${xxx}` 目录
```
publish-sftp -c xxx
```#### remove
> 删除 remotePath 目录, 如果 xxx 有值则是删除 `${remotePath}/${xxx}` 目录
```
publish-sftp -r xxx
```### Tips
> protectedRemotePath 字段为避免误操作增加,删除等危险操作涉及到该目录会立即终止 ⚠️