Publish Sftp Save

One-line command to quickly publish resources to a specified server

Project README

Logo

One-line command to quickly publish resources to a specified server..

NPM Version Package License NPM Downloads

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

image

复制 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 字段为避免误操作增加,删除等危险操作涉及到该目录会立即终止 ⚠️

Open Source Agenda is not affiliated with "Publish Sftp" Project. README Source: xiaoxiaojx/publish-sftp
Stars
44
Open Issues
0
Last Commit
2 years ago

Open Source Agenda Badge

Open Source Agenda Rating