@additive/colt 中文文档教程
ADDITIVE CLI
这个包提供了一些 CLI 工具用于一些 ADDITIVE 项目。
Install
npm install --save-dev @additive/colt
Config
我们正在使用 cosmiconfig
Packager
Usage: packager|p [options] [dest]
Zip some files and folders to an comfortable package.
Options:
--files [files...] optional array of files
--folders [folders...] optional array of folders
--globs [globs...] optional globs of files or folders
-h, --help output usage information
或通过配置添加选项文件:
{
packager: {
files: ["index.js"],
folders: ["src/"],
globs: ["package*.json", ".*/"],
destination: "tmp",
filename: "additive-backup"
}
}
Uploader
Usage: uploader|u [options]
Upload files and folders to a remote source. Options can be set in a separate config file.
Options:
-h, --help output usage information
通过配置文件添加选项:
{
uploader: {
sources: [
'modules/'
],
includes: [
'.editorconfig',
'package*.json'
],
excludes: ['.git/', 'logs', '._*', '.*/', '.*', 'node_modules/'],
config: {
host: '127.0.0.1',
port: 22, // default
user: 'root',
pass: '',
local: './',
remote: '/srv/var/apache/vhosts',
dryrun: true // run without syncing to the server
}
}
}
目前我们不能自动将密码传递给rsync,这就是为什么 它将被复制到您的剪贴板中。 如果我们想使用它,我们需要使用 服务器端的 sshpass 或任何其他解决方案。
ADDITIVE CLI
This package provides some CLI tools for use with some ADDITIVE projects.
Install
npm install --save-dev @additive/colt
Config
we are using cosmiconfig
Packager
Usage: packager|p [options] [dest]
Zip some files and folders to an comfortable package.
Options:
--files [files...] optional array of files
--folders [folders...] optional array of folders
--globs [globs...] optional globs of files or folders
-h, --help output usage information
or add options via the config file:
{
packager: {
files: ["index.js"],
folders: ["src/"],
globs: ["package*.json", ".*/"],
destination: "tmp",
filename: "additive-backup"
}
}
Uploader
Usage: uploader|u [options]
Upload files and folders to a remote source. Options can be set in a separate config file.
Options:
-h, --help output usage information
add options via the config file:
{
uploader: {
sources: [
'modules/'
],
includes: [
'.editorconfig',
'package*.json'
],
excludes: ['.git/', 'logs', '._*', '.*/', '.*', 'node_modules/'],
config: {
host: '127.0.0.1',
port: 22, // default
user: 'root',
pass: '',
local: './',
remote: '/srv/var/apache/vhosts',
dryrun: true // run without syncing to the server
}
}
}
At the moment we can not automaticall pass the password to rsync, that is why it will be copied into your clipboard. If we want to use it, we need to use sshpass on server side or any other solution.