git clone https://github.com/Bottle1206/SFTP-space.git
cd SFTP-space && npm install
npm link
在项目文件夹根目录添加一个server.json 文件:
文件格式如下(example):
{
"host": "192.168.111.111",
"port": 22,
"username": "root",
"password": "123456",
"pathMap": {
"localPath": "./dist",
"remotePath": "/usr/local/nginx/html/spaceItems/myProject"
}
}
在项目文件夹中的 package.json 中添加script:
"upload": "space send -c server.json"
npm run upload